这是我第一次在React中制作图形,因此我遵循指南和文档。我没有图形学,sigma.js或 reactigma (我知道如何知道如何知道使用正常反应)。
设置文档说:
在您的应用程序中导入React Sigma样式文件。示例:导入“@react-sigma/core/lib/react-sigma.min.css”
什么是样式文件? CSS?我该怎么做?我找不到任何文档。 Is it something basic from a previous library?

Honestly我发现很难学习Sigma.js并将其插入我的React网站。我找不到任何指南。有吗?我只想从一个简单的图表开始,然后从那里学习。
This is my first time making graphs in React so I'm following the guide and documentation. I have no prior experience with graphology, sigma.js or react-sigma (I know how to use normal React).
The setup documentation says:
Import the React Sigma style file in your application. Example : import "@react-sigma/core/lib/react-sigma.min.css"
What are style files? CSS? How can I make one? I can't find any documentation. Is it something basic from a previous library?

Honestly I'm finding it very hard to learn sigma.js and insert it in my react website. I can't find any guides. Are there any? I just want to start with a simple graph and learn from there.
发布评论
评论(1)
The documentation refers specifically to their own CSS file which must be imported in a React app like they are showing in the example:
Disclaimer: depending on your React app setup, the way to import a CSS file might differ.
The example in the documentation was broken when I wrote this answer.我打开关于react-sigma repo 的问题,从那时起就解决了。
当我尝试使用时,缺少一些依赖性,需要进行一些更改。
Note that I used TypeScript for the example, which gives insightful error messages since react-sigma< /em>提供自己的类型。
然后很明显,
useloadgraph
挂钩未正确使用,因为它不接受任何参数,并且返回一个函数接受graph
参数。可以用 api文档)。我还认为 lodash 开发人员控制台中的错误缺少。
请参阅文档迄今为止。
The documentation refers specifically to their own CSS file which must be imported in a React app like they are showing in the example:
Disclaimer: depending on your React app setup, the way to import a CSS file might differ.
The example in the documentation was broken when I wrote this answer. I opened an issue on the react-sigma repo and it was fixed since then.
When I tried it, some dependencies were missing and some changes were needed.
Note that I used TypeScript for the example, which gives insightful error messages since react-sigma provides its own types.
Then it was clear that the
useLoadGraph
hook wasn't used properly since it doesn't accept any parameter and it returns a function accepting agraph
parameter. This can be confirmed with the API documentation.I also figured that lodash was missing from errors in the developer console.
Please refer to the documentation as it's now up-to-date.