Comments (8)
I tried to upgrade d3-graphviz in this package, however the test now fails: it seems it doesn't render anything:
I also get a fault:
both async and sync fetching of the wasm failed
from graphviz-react.
Hi @bigbug,
The version bump of d3-graphviz
to v3
is a major bump because it contains breaking changes from v2
, which is why when you have tried to update it yourself you are getting failing tests and nothing being rendered.
I agree it would be nice to upgrade the dependency to v3
if possible. I had a short look when v3
was first released and could not come up with a satisfactory solution that didn't require WASM to be included manually in any page using the component. I will have another look at it when I get a chance to see if there's a way to upgrade without making breaking changes to this component but feel free to have a look yourself if you are interested.
Also, it's likely that any changes will require the test snapshots to be regenerated. Because this component provides a very slim wrapper over d3-graphviz
there's not a lot to test (essentially all it does is provide an HTML element for d3-graphviz
to attach its SVG to in a React flavoured way and handle updates being passed to d3-graphviz
) so the tests just ensure that the component rendered the elements as expected.
from graphviz-react.
Yeah, I thought this bump would be easy but then I got from one problem to another ... before this I also didn't know about wasm so ...
As you said the wasm file would have to be included in the build - so for CRA this would be /public/
What do you think about post install scripts?
https://stackoverflow.com/questions/34781630/how-to-automatically-copy-files-from-package-to-local-directory-via-postinstall
from graphviz-react.
@bigbug if you want to put together a proof of concept using post install I'd be happy to look at it.
I'm not sure without looking at it in detail whether it would work or not though. Presumably the post install would copy the WASM file but this would still need to be referenced in a script
tag in the user's index file? The approach also needs to work for any React framework, not just CRA.
from graphviz-react.
Here's to hoping someone finds a path forward one day.
from graphviz-react.
Here's to hoping someone finds a path forward one day.
@dustinlacewell please feel free to look for the path yourself if you are keen to see this done.
from graphviz-react.
I was able to get graphviz-react working with latest d3-graphiz and nextjs by using webpack to copy the .wasm
files to .next/static/chunks/pages/
which is where it was looking for them on import.
I guess it really isn't a solution for this library though, sorry :(
from graphviz-react.
d3-Graphviz reached now version 4.4.0. I run into trouble with the @types/d3-graphviz that I cannot handle myself. :-(
Would love to see that somebody with more than 1 months of Typescript experience looks into this. Thank you for consideration!
from graphviz-react.
Related Issues (19)
- Fill and resize with parent container HOT 4
- how do you background color of graph? HOT 4
- Thanks! - I ported this to Angular HOT 1
- FATAL ERROR: heap out of memory HOT 3
- Trouble installing HOT 16
- onClick event handler with graphviz-react HOT 9
- can't disable zoom after it has been enabled HOT 6
- HTML-like Labels support? HOT 3
- Transitions and Webworker HOT 4
- Unable to import package HOT 12
- useWorker warning HOT 2
- Invalid asm.js: Function definition doesn't match use HOT 1
- graphviz-react 1.2.3 not resolved correctly with create-react-app HOT 1
- Add Styling to Demo HOT 1
- Invalid hook call `useMemo` HOT 2
- Graphviz-react not imported correctly with create-react-app default jest configuration HOT 2
- d3-color severe vulnerability HOT 10
- Add Tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphviz-react.