reactjs - 在反应中创建动态树
问题描述
我想在 React 应用程序中构建动态树,为此我正在使用带有外部源(CSV 文件)的D3库。
这个 CSV 文件是动态更新的,问题是这个文件位于 React 源文件夹中,所以每次文件更改时,整个应用程序都会重新加载。我只希望树重新加载它,因为我在重新加载时丢失了所有其他输入的信息。
componentWillMount() {
treeUtil.parseCSV(csvSource)
.then((data) => {
this.setState({ data });
console.log('This is the new data for the tree', data);
})
.catch((err) => console.error(err));
}
有人能帮我吗?
解决方案
推荐阅读
- java - 在 Spring WebFlux 中修改请求正文
- apache-spark - 如何修复 pyspark EMR Notebook 上的错误 - AnalysisException:无法实例化 org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
- r - 获取目录中没有子目录名称的文件列表
- android - CrossAxisAlignment.center 永远不会在列中工作
- ios - IOS/AppStore 如何提交现有应用的新版本以供审核
- c++ - 自从迁移到 64 位后,我在随机 glVertexAttribArray 调用中收到来自 nvoglv64.dll 的访问冲突
- authentication - 如何通过 URL 中的个人访问令牌访问 GitHub
- javascript - 如何使用 Node.js MongoDB 驱动程序插入 long/BigInt?
- bash - 如何以root身份打开桌面条目?
- visual-studio - BizTalk 和 Visual Studio 2017