本文介绍了添加JavaScript和CSS文件来反应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将d3时间序列图与react集成在一起.

I'm integrating d3-timeseries graph with react.

因此,此图使用了自己的2个javascript文件和1个CSS文件中的3个文件.

So, this graph uses 3 files of its own 2 javascript files and one css file.

文件在这里可用: https://github.com/mcaule/d3-timeseries/tree/master/src

另一个文件是:

<script src="https://d3js.org/d3.v3.min.js"></script>

在我的React应用中,应如何引用所有这些d3 javascript和CSS文件?因此,到目前为止,我只在html中包括了所有这些文件的标签.如何做出反应?

In my react app, how should refer all these d3 javascript and css files? So, far I just included tags for all these files in my html. How to do it in react?

另外,我应该将d3-timeseries javascript代码放入某个文件中,或者仅使用进行引用.请提出建议,我是新来的人.谢谢.

Also,d3-timeseries javascript code i should put in some file or refer only using . Please suggest, I'm new to react. Thanks.

推荐答案

由于d3和React的渲染概念不同,因此很难将d3集成到React中.

Because the rendering of d3 and React differ in their concepts, its quite hard to integrate d3 inside React.

最好使用提供此软件包的React-Way D3: http://www.reactd3.org

Its maybe better to use the React-Way D3 which provides this package:http://www.reactd3.org

这篇关于添加JavaScript和CSS文件来反应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 04:40