{"action":"created","issue":{"url":"https://api.github.com/repos/jacomyal/sigma.js/issues/825","repository_url":"https://api.github.com/repos/jacomyal/sigma.js","labels_url":"https://api.github.com/repos/jacomyal/sigma.js/issues/825/labels{/name}","comments_url":"https://api.github.com/repos/jacomyal/sigma.js/issues/825/comments","events_url":"https://api.github.com/repos/jacomyal/sigma.js/issues/825/events","html_url":"https://github.com/jacomyal/sigma.js/issues/825","id":206103522,"node_id":"MDU6SXNzdWUyMDYxMDM1MjI=","number":825,"title":"Angular 2 Compatability?","user":{"login":"viztastic","id":8556736,"node_id":"MDQ6VXNlcjg1NTY3MzY=","avatar_url":"https://avatars2.githubusercontent.com/u/8556736?v=4","gravatar_id":"","url":"https://api.github.com/users/viztastic","html_url":"https://github.com/viztastic","followers_url":"https://api.github.com/users/viztastic/followers","following_url":"https://api.github.com/users/viztastic/following{/other_user}","gists_url":"https://api.github.com/users/viztastic/gists{/gist_id}","starred_url":"https://api.github.com/users/viztastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viztastic/subscriptions","organizations_url":"https://api.github.com/users/viztastic/orgs","repos_url":"https://api.github.com/users/viztastic/repos","events_url":"https://api.github.com/users/viztastic/events{/privacy}","received_events_url":"https://api.github.com/users/viztastic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-02-08T05:55:58Z","updated_at":"2018-06-12T15:35:45Z","closed_at":null,"author_association":"NONE","body":"I am unable to get the example working with angular 2.\r\n\r\nSteps to reproduce:\r\n\r\n1. `npm install sigma`\r\n2. Create angular component (with angular-cli): `ng g component about`\r\n3. Add the following code to the component:\r\n\r\n```typescript\r\n import { Component, OnInit, AfterViewInit } from '@angular/core';\r\n const sigma = require('sigma');\r\n require('../../../../node_modules/sigma/build/plugins/sigma.parsers.json.min.js');\r\n\r\n  @Component({\r\n    selector: 'ib-about',\r\n    templateUrl: './about.component.html',\r\n    styleUrls: ['./about.component.scss']\r\n  })\r\n  export class AboutComponent implements OnInit, AfterViewInit {\r\n  constructor() { }\r\n\r\n    ngOnInit() {\r\n    }\r\n    jsonData = { copy of the example data on sigmajs.org page } \r\n    ngAfterViewInit() {\r\n      sigma.parsers.json(this.jsonData, {\r\n        container: 'container',\r\n        settings: {\r\n          defaultNodeColor: '#ec5148'\r\n        }\r\n    });\r\n```\r\n\r\nI get the following error: \r\n\r\n![screen shot 2017-02-08 at 4 43 30 pm](https://cloud.githubusercontent.com/assets/8556736/22724927/c7c0b848-ee1d-11e6-915c-fee575ce6fe6.png)\r\n\r\n\r\nIs there a reference Angular 2 implementation for this?"},"comment":{"url":"https://api.github.com/repos/jacomyal/sigma.js/issues/comments/396634620","html_url":"https://github.com/jacomyal/sigma.js/issues/825#issuecomment-396634620","issue_url":"https://api.github.com/repos/jacomyal/sigma.js/issues/825","id":396634620,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjYzNDYyMA==","user":{"login":"Yomguithereal","id":2571951,"node_id":"MDQ6VXNlcjI1NzE5NTE=","avatar_url":"https://avatars1.githubusercontent.com/u/2571951?v=4","gravatar_id":"","url":"https://api.github.com/users/Yomguithereal","html_url":"https://github.com/Yomguithereal","followers_url":"https://api.github.com/users/Yomguithereal/followers","following_url":"https://api.github.com/users/Yomguithereal/following{/other_user}","gists_url":"https://api.github.com/users/Yomguithereal/gists{/gist_id}","starred_url":"https://api.github.com/users/Yomguithereal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yomguithereal/subscriptions","organizations_url":"https://api.github.com/users/Yomguithereal/orgs","repos_url":"https://api.github.com/users/Yomguithereal/repos","events_url":"https://api.github.com/users/Yomguithereal/events{/privacy}","received_events_url":"https://api.github.com/users/Yomguithereal/received_events","type":"User","site_admin":false},"created_at":"2018-06-12T15:35:45Z","updated_at":"2018-06-12T15:35:45Z","author_association":"COLLABORATOR","body":"You need to expose sigma as a global variable. You can try:\r\n\r\n```js\r\nwindow.sigma = require('sigma');\r\n```\r\n\r\nThen import your plugins."}}
{"actor":{"display_login":"Yomguithereal"}}