Git Product home page Git Product logo

Comments (6)

tomwanzek avatar tomwanzek commented on July 18, 2024

Thanks for the take. I do not seem to experience the problem so far. The associated demo I built in tomwanzek/d3-ng2-demo and the live github page for a few reference components seems to handle the events as expected.

The injected service singleton seems to work alright in the project generated from the angular-cli webpack version (1.0.0-beta.11-webpack.8. with some dependency fixes for typescript and awesome-typescript-loader.)

Did you experience a different event-handling use case, where you saw the live-binding issue?

from d3-ng2-service.

ocombe avatar ocombe commented on July 18, 2024

Hmm I need to recheck, maybe it was fixed in one of the patches

from d3-ng2-service.

ocombe avatar ocombe commented on July 18, 2024

No I still have the problem but I import directly from d3-selection in a vendor.ts files that is bundled for all my modules, maybe that's the problem, I don't create a new instance of the d3 lib for each component

from d3-ng2-service.

tomwanzek avatar tomwanzek commented on July 18, 2024

Try writing it as a service, that way you have a singleton, which is created once and that is the one you pull in. Feel free to look at the source code in the repo, I always just pull directly from the import that feeding the service.

Another possible explanation could have to do with which module system the TS code is compiled to. I matched mine essentially to the one used by angular-cli. But, if one goes commonjs, say, that might lead to a different experience with d3.event.

from d3-ng2-service.

tomwanzek avatar tomwanzek commented on July 18, 2024

I'm closing this issue. If you experience the issue using this service, let me know and I will reopen it. Cheers.

from d3-ng2-service.

ocombe avatar ocombe commented on July 18, 2024

Yup, no prob :)

from d3-ng2-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.