swimlane / ngx-graph

Graph visualization library for angular
https://swimlane.github.io/ngx-graph
MIT License
933 stars 285 forks source link

TouchEvent is not defined error on module import #99

Closed annafougeras closed 5 years ago

annafougeras commented 6 years ago

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior When importing NgxGraphModule I get a ReferenceError in Firefox. There was no error when using ngx-graph 5.0.1.

Reproduction of the problem

import { NgxGraphModule } from '@swimlane/ngx-graph';

@NgModule({
  imports: [
    ...
    NgxGraphModule,
  ],
})
export class MyModule {}

image

Please tell us about your environment:

enigmatic commented 6 years ago

It should be a simple fix https://stackoverflow.com/questions/27313488/touchevent-not-working-in-firefox-and-other-website-browser#32882849

nicosaliagas commented 6 years ago

I've got the same error on Firefox but not on Chrome. It doesn't work neither on IE 11 and Edge When do you think this bogue will be resolved? Thanks in advance for a quick fix :)

duanqz commented 6 years ago

The same error on Firefox and Safari, but OK with Chrome.

ERROR Error: "Uncaught (in promise): ReferenceError: TouchEvent is not defined ./src/index.ts/graph_component_GraphComponent<@http://localhost:4200/app-pages-pages-module.js:77726:42 ./src/index.ts@http://localhost:4200/app-pages-pages-module.js:76843:53 __webpack_require__@http://localhost:4200/app-pages-pages-module.js:2817:12 ./node_modules/@swimlane/ngx-graph/release/index.js/</<@http://localhost:4200/app-pages-pages-module.js:2860:18 ./node_modules/@swimlane/ngx-graph/release/index.js/<@http://localhost:4200/app-pages-pages-module.js:2798:18 webpackUniversalModuleDefinition@http://localhost:4200/app-pages-pages-module.js:2795:20 ./node_modules/@swimlane/ngx-graph/release/index.js@http://localhost:4200/app-pages-pages-module.js:2793:11 __webpack_require__@http://localhost:4200/runtime.js:82:12 ./src/app/pages/widget/widget.module.ts@http://localhost:4200/app-pages-pages-module.js:138013:78 __webpack_require__@http://localhost:4200/runtime.js:82:12 ./src/app/pages/dashboard/dashboard.module.ts@http://localhost:4200/app-pages-pages-module.js:136572:79 __webpack_require__@http://localhost:4200/runtime.js:82:12 ./src/app/pages/pages.module.ts@http://localhost:4200/app-pages-pages-module.js:137104:85 __webpack_require__@http://localhost:4200/runtime.js:82:12 webpackAsyncContext/<@http://localhost:4200/main.js:66:16 ./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invoke@http://localhost:4200/polyfills.js:7816:17 onInvoke@http://localhost:4200/vendor.js:41860:24 ./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invoke@http://localhost:4200/polyfills.js:7815:17 ./node_modules/zone.js/dist/zone.js/</Zone.prototype.run@http://localhost:4200/polyfills.js:7566:24 scheduleResolveOrReject/<@http://localhost:4200/polyfills.js:8300:29 ./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.js:7849:17 onInvokeTask@http://localhost:4200/vendor.js:41851:24 ./node_modules/zone.js/dist/zone.js/</ZoneDelegate.prototype.invokeTask@http://localhost:4200/polyfills.js:7848:17 ./node_modules/zone.js/dist/zone.js/</Zone.prototype.runTask@http://localhost:4200/polyfills.js:7616:28 drainMicroTaskQueue@http://localhost:4200/polyfills.js:8023:25 "

aniruddhadas9 commented 6 years ago

I am also getting the same issue. Any one have a workaround so solved this

nicosaliagas commented 6 years ago

Is someone knows another angular library for doing this? thanks :)

LoaderB0T commented 6 years ago

Hi, so I have never contributed to any open source project and have never used GitHub, but I have locally fixed this issue by replacing the touch events with pointer events. But I can't figure out how to commit to this project, can anybody help?

aniruddhadas9 commented 6 years ago

Hi, so I have never contributed to any open source project and have never used GitHub, but I have locally fixed this issue by replacing the touch events with pointer events. But I can't figure out how to commit to this project, can anybody help?

@LoaderB0T fork the repo and they commit your code into your fork and they create a pull request so that owner and others can review it and finally merge it to the final one.

https://help.github.com/articles/working-with-forks/

nicosaliagas commented 6 years ago

@LoaderB0T did you achieved to make your pull request ?

LoaderB0T commented 6 years ago

@nicosaliagas Sorry to disappoint you, but we decided not to use the library due to mayor compatability issues with IE11. As mich as I would like to ditch it we have to support it for some of our customers.

nicosaliagas commented 6 years ago

@LoaderB0T did you use another similar lib ? I could be interested if so... :) Thanks

LoaderB0T commented 6 years ago

@nicosaliagas I used dagre without the design stuff and created my own svg graphics based on the calculated coordinates from dagrejs. (There are dts files for it)

isaacplmann commented 6 years ago

This issue is fixed in version 5.1.1

assafsun commented 5 years ago

Hi! when version 5.1.1 will be release? Can you please give more details on the fix?

marjan-georgiev commented 5 years ago

5.1.1 has been released for a while but the tag was not pushed to github. It is now. Also, 5.1.2 was released yesterday with updated dependencies. Closing this.

sw2go commented 5 years ago

the problem still remains, ReferenceError: TouchEvent is not defined see: https://github.com/sw2go/nodelink. Hack-Solution: remove: @HostListener('document:touchmove', ['$event']) in graph.component.ts