-
Notifications
You must be signed in to change notification settings - Fork 9
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
Difficulty running example code locally #21
Comments
I took my own advice and switched to webpack. Project structure
webpack.config.js
package.json
For
Build to
|
UPDATE Yeah, it's finally working after my colleague and I spent a hour troubleshooting issues from my last post. To fix 404 errors for import DependenTree from '@square/dependentree';
import royals from './royals.js';
window.DependenTree = DependenTree;
window.royals = royals; Swapped content in //let currentEntity = 'Elizabeth II';
//let direction = 'downstream';
t.setTree(currentEntity, direction);
</script>
</html> Next, updated <script type="text/javascript" src="dependentree.js"></script>
<script type="text/javascript" src="royals.js"></script> ...to this: <script type="text/javascript" src="main.js"></script>
<!-- script type="text/javascript" src="royals.js"></script -->
<script> Lastly, the browser kept saying // Adds data
t.addEntities(clone(testData.royals)); //---> changed to tree.addEntities(royals); We're not sure if this is the correct way of using dependentree but it's how we got it working. |
Hello, i tried the adjustments you made but in react, just getting a blank page |
This library is amazing. We've been looking for something in d3 for illustrating bidirectional upstream and downstream software dependencies. Your implementation is not only perfect but sleek and smooth - it's really beautiful, so kudos to your efforts,
Now the bad news. I spent several hours trying to get the example code working from the README. I'm no frontend expert, but I've built websites in the past (years ago) and definitely not a stranger to HTML and JS, even tinkered with NodeJS but nothing serious. I created
index.html
from this snippet in Quickstart, added a simpleindex.js
to serve up static content, then ran withnode index.js
and immediately got NOT FOUND errors fordependentree.js
androyal.js
. Troubleshooted and hacked together a solution for loading script resources but it still doesn't load properly.My suspicion is I'm running the code incorrectly. Should I be using webpack? If so, that's fine, I'll figure it out but I just want to make sure it's the right path.
The text was updated successfully, but these errors were encountered: