GraphAlchemist / Alchemy

Other
517 stars 234 forks source link

Following Examles and Getting Nothing but errors #576

Closed JustinGOSSES closed 7 years ago

JustinGOSSES commented 8 years ago

I'm following the examples exactly (copied and pasted) and not able to get it to work with the current version. I've tried using CDN links for the JS and CSS alchemy files as well as using locally hosted versions of those files that were cloned from github. Both times (and using both chrome and safari), I get these two errors:

  1. SyntaxError: Unexpected token '<' (anonymous function) — alchemy.min.js:1
  2. ReferenceError: Can't find variable: Alchemy

I copied this example from the examples page, first example:

<html>
<head>
  <link rel="stylesheet" href="http://cdn.graphalchemist.com/alchemy.min.css"/>
</head>
<body>
  <div class="alchemy" id="alchemy"></div>

  <script src="http://cdn.graphalchemist.com/alchemy.min.js"></script>
  <script type="text/javascript">
        var config = {
            dataSource: 'data/charlize.json',
            };

        alchemy = new Alchemy(config)
    </script>
  </body>
</html>

I also copied the example data from the same page and put it in a folder called data. The html and data come form the first example found on this page: http://graphalchemist.github.io/Alchemy/#/examples

The second error looks like a side effect of the first.

htaunay commented 8 years ago

I got the same errors you did, and managed to fix them by using Alchemy locally instead of through the CDN. Unfortunately, even with the latest version locally I just switch form the old errors to these new ones:

ReferenceError: d3 is not defined
TypeError: c is not a function

I suspect that these examples might be broken.

htaunay commented 8 years ago

Ok, I managed to get some examples running by:

  <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.16.4/lodash.min.js"></script>

Hope it helps!

willi-mueller commented 7 years ago

you can also include the vendor.js in the local download which includes all dependencies. For me the following works:

<div class="alchemy" id="alchemy"></div>
<script src="0.4.2/scripts/vendor.js"></script>
<script src="0.4.2/alchemy.js"></script>
gudyo commented 7 years ago

i started out with having alchemy locally and referencing all the files and still nothing. I get alchemy.begin() doesn't exist, same for alchemy.begin(conf)... there is just no such thing as begin

taylorren commented 6 years ago

Reference to CDN now prompts 302 and 403 error - CDN is no longer supported?

Download the latest ZIP from Github and put all files locally. Then followed @jups23 input but no output at all.