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

Example #2

Open
omidb opened this issue May 1, 2015 · 7 comments
Open

Example #2

omidb opened this issue May 1, 2015 · 7 comments
Labels

Comments

@omidb
Copy link

omidb commented May 1, 2015

Hi,

Is there any example to show how to use the code?

thanks

@mysticfall
Copy link
Member

Hi,

As the description says, it's still at a proof-of-concept stage and primarily used for our own internal development. So far, we only needed the selection API, so it's the only implemented part of D3 library for now.

In future, we might write suitable documentation and examples for it, if we are convinced about its general usefulness. Until then, I wouldn't encourage anyone from using it in their project unless they are willing to modify it themselves when it's necessary.

For pointers, you can either import '_com.greencatsoft.d3.svg.' or '_com.greencatsoft.d3.html.' and try calling methods on elements which are defined in traits under the selection package. They mostly corresponds to D3's original API, so you can consult their documentation for usage.

For SVG transformation, there are some useful methods in the commons package also.

Sorry I couldn't help much.

@PhilAndrew
Copy link

There's a D3 mapping here just for interest as it may not be as well known https://github.com/mathieuleclaire/scaladget/blob/master/scaladget/src/main/scala/fr/iscpif/scaladget/mapping/d3mapping.scala

@mysticfall
Copy link
Member

Thanks for the head up :)

@GWoodmansey
Copy link

This isn't a bug but may indicate that one exists.

I've been trying to run the demo of this project to see if it will help my on a project.

My System: Lubuntu System 16.04 LTS, Scala 2.11.8, Java 1.8.0_111, Scala.js 0.6.13, Node 0.9.9, NPM 1.2.10

When I run

fastOptJS

I have no problem.

compile

also runs quickly, in a second, and gives no error but likely did nothing.

When the

run

command is entered I get the following:

    java.lang.RuntimeException: No main class detected.
at scala.sys.package$.error(package.scala:27)
    [trace] Stack trace suppressed: run last scaladget-master/compile:run for the full output.
    [error] (scaladget-master/compile:run) No main class detected.
    [error] Total time: 2 s, completed 26-Dec-2016 9:40:49 PM

and when the

runDemo

command is entered I get the following:

[info] Updating NPM dependencies
    [trace] Stack trace suppressed: run last demo/compile:npmUpdate for the full output.
    [error] (demo/compile:npmUpdate) java.io.IOException: Cannot run program "npm" (in directory "/home/gordon/scaladget-master/demo/target/scala-2.11/scalajs-bundler/main"): error=2, No such file or directory
    [error] Total time: 6 s, completed 26-Dec-2016 9:43:45 PM

After installing Node.js and NPM I get the following when running, runDemo again:

runDemo
[info] Updating NPM dependencies
[error] npm ERR! Error: No 'name' field
[error] npm ERR!     at validName (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:557:40)
[error] npm ERR!     at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:340:27)
[error] npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:140:33
[error] npm ERR!     at cb (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:48:11)
[error] npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:320:48
[error] npm ERR!     at fs.js:182:20
[error] npm ERR!     at Object.oncomplete (fs.js:93:15)
[error] npm ERR!     at process._makeCallback (node.js:318:24)
[error] npm ERR! If you need help, you may report this log at:
[error] npm ERR!     <http://github.com/isaacs/npm/issues>
[error] npm ERR! or email it to:
[error] npm ERR!     <[email protected]>
[error] 
[error] npm ERR! System Linux 4.4.0-57-generic
[error] npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "update"
[error] npm ERR! cwd /home/gordon/scaladget-master/demo/target/scala-2.11/scalajs-bundler/main
[error] npm ERR! node -v v0.9.9
[error] npm ERR! npm -v 1.2.10
[error] npm ERR! 
[error] npm ERR! Additional logging details can be found in:
[error] npm ERR!     /home/gordon/scaladget-master/demo/target/scala-2.11/scalajs-bundler/main/npm-debug.log
[error] npm ERR! not ok code 0
[trace] Stack trace suppressed: run last demo/compile:npmUpdate for the full output.
[error] (demo/compile:npmUpdate) Non-zero exit code: 1
[error] Total time: 7 s, completed 26-Dec-2016 11:27:21 PM

What should I do here to get the demo working?

@mysticfall
Copy link
Member

@GWoodmansey I'm afraid you are a bit confused about your settings because the log shows scaladget, which is an entirely different project than scalajs-d3 which does not have any demo application of its own.

@GWoodmansey
Copy link

GWoodmansey commented Jan 13, 2017 via email

@mysticfall
Copy link
Member

@GWoodmansey As Bootstrap's public API contains only a small number of functions, I suppose writing a facade for the library would be a pretty easy task. You might want to read the relevant section in the official documentation if you haven't already:

And I just found an existing binding for Bootstrap as well, although I haven't used it myself:

It seems to be much more than a simple wrapper for the library, but I suppose you can at least take some hints from it if you intent to write a facade yourself.

And as a final note, I'd like to suggest to post a question to the Scala.js mailing list if you need further help on this specific subject. I believe the chances of getting more relevant answers would be much higher in the mailing list, because this project isn't really actively developed and this issue has little to do with Bootstrap library.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants