Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

biojs snippets #1

Closed
wilzbach opened this issue Dec 9, 2014 · 4 comments
Closed

biojs snippets #1

wilzbach opened this issue Dec 9, 2014 · 4 comments
Milestone

Comments

@wilzbach
Copy link
Contributor

wilzbach commented Dec 9, 2014

I just saw that you published this nice component. Nice!

Also I saw that the "snippets" documentation isn't pefect yet, so I just post here what I saw in your package - maybe it helps you.

  • if you want the snippets to work on JSBin etc. the link needs to be relative (data -> ./data). Otherwise there is no way for the registry to fix the path
  • the sniper "magic" is that it creates a default html with one div (if one doesn't specify a html page)
var yourDiv = document.getElementById('zg036315rk9');

So if you use the string "yourDiv" d3 won't find the injected element and d3 will use document.body as fallback. As yourDiv is a DOM reference you can pass it directly to D3 like target: yourDiv, or you can also get its id with yourDiv.id

@mpschr
Copy link
Contributor

mpschr commented Dec 9, 2014

Hey,

Thanks for the hints. I'll have a look.

I have an additional question concerning the .css file. The example at 'http://workmen.biojs.net/demo/muts-needle-plot/distributedMuts' tries to fetch the css as follows:

<link type="text/css" rel="stylesheet" href="/github/bbglab/muts-needle-plot/master/build/muts-needle-plot.css">

Where is this path coming from? In the package.json there is a css entry in the sniper-section:

  "sniper": {
    "js": [
      "/build/muts-needle-plot.js"
    ],
    "css" : [
      "/build/muts-needle-plot.css"
    ],
    "snippets": [
      "snippets"
    ],
    "first": "distributedMuts"
  }

@wilzbach
Copy link
Contributor Author

Where is this path coming from?

All JS files in the build dir are replaced with the browserified version, however at the moment we haven't agreed on a "CSS browserify" yet (nor for documentation).

That is why the registry-workmen translates all path (except for the js build dir) starting with / to the github proxy github.

/github is just a proxy to rawgithubusercontent.com, but allows CORS requests

@mpschr
Copy link
Contributor

mpschr commented Dec 10, 2014

Ok - I have added the build-directory to the github (It was not there). I hope it will work.

@mpschr
Copy link
Contributor

mpschr commented Dec 10, 2014

Working

@mpschr mpschr closed this as completed Dec 10, 2014
@mpschr mpschr added this to the 1.0.0 milestone Dec 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants