Giter VIP home page Giter VIP logo

Comments (7)

andredumas avatar andredumas commented on June 21, 2024

Apart from this test, I haven't tried using the library as a pure npm module, I assumed it should work. Briefly reviewing the code I don't think it will work and this should be tidied up.

from techan.js.

caktux avatar caktux commented on June 21, 2024

Commiting build/version.js and adding "main": "src/techan.js", to package.json is probably all that's needed.

from techan.js.

andredumas avatar andredumas commented on June 21, 2024

I've added main and d3 dependency. D3 is not correctly require'd just yet, it is assumed to be in global scope. I'll fix this. This workaround should be enough to get you going for now:

package.json snip

  "dependencies": {
    "techan": "andredumas/techan.js#bb598210d3770ef1f5fd32e05081fad231431815",
    "d3": "~3.5.3"
  }

Example:

// D3 into global scope, otherwise an error will be thrown
global.d3 = require('d3');
var techan = require('techan');
console.log('d3.version', d3.version);
console.log('techan.version', techan.version);

I probably should look at publishing to npm registry at some stage.

from techan.js.

caktux avatar caktux commented on June 21, 2024

main needs to point to src/techan.js, not dist/techan.js, and build/version.js is required in the repo for that

from techan.js.

caktux avatar caktux commented on June 21, 2024

You totally just ignored my comments, this is still an issue...

from techan.js.

andredumas avatar andredumas commented on June 21, 2024

The library was designed to be only included as a bower or npm dependency, in each case dist/techan.js or dist/techan.min.js being the entry point, hence each build has these committed. build/version.js shouldn't be committed. I use as both now without issue, not to say there isn't any but it is working for me.

http://bl.ocks.org/andredumas/ad585d6d68cf8a894207

from techan.js.

overwatch13 avatar overwatch13 commented on June 21, 2024

When I try to reference techan when using requireJs throws and error right off the bat. I could really use this on my site, any ideas?
techan-error

from techan.js.

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.