背景

调查了react下的图工具库, 并继承到项目中, 经过调研列出如下两个图工具库,可以同时使用。

data-ui

react-c3js

在一个工具中没有所需的图时候, 可以使用另一个替代。

data-ui

https://williaster.github.io/data-ui/?selectedKind=histogram&selectedStory=Playground&full=0&addons=0&stories=1&panelRight=0

A collection of custom + wrapped components for data-rich (desktop) UIs.

@data-ui/xy-chart
@data-ui/histogram
@data-ui/sparkline
@data-ui/network
@data-ui/radial-chart
@data-ui/event-flow
@data-ui/data-table
@data-ui/theme
@data-ui/demo

react-c3js

https://github.com/bcbcarl/react-c3js

React component for C3.js

import C3Chart from 'react-c3js';
import 'c3/c3.css'; const data = {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25]
]
}; const mountNode = document.getElementById('react-c3js'); ReactDOM.render(<C3Chart data={data} />, mountNode);

其属性都是继承与C3, 可以使用C3的配置设置为此处的组件的属性。

https://c3js.org/

Properties

Check out C3.js Reference for more details.

  • data
  • title
  • size
  • padding
  • color
  • interaction
  • transition
  • oninit
  • onrendered
  • onmouseover
  • onmouseout
  • onresize
  • onresized
  • axis
  • grid
  • regions
  • legend
  • tooltip
  • subchart
  • zoom
  • point
  • line
  • area
  • bar
  • pie
  • donut
  • gauge
  • className
  • style
  • unloadBeforeLoad
  • onPropsChanged

C3

https://c3js.org/

D3-based reusable chart library

c3 is a D3-based reusable chart library that enables deeper integration of charts into web applications.

Why C3?

Comfortable

C3 makes it easy to generate D3-based charts by wrapping the code required to construct the entire chart. We don't need to write D3 code any more.

Customizable

C3 gives some classes to each element when generating, so you can define a custom style by the class and it's possible to extend the structure directly by D3.

Controllable

C3 provides a variety of APIs and callbacks to access the state of the chart. By using them, you can update the chart even after it's rendered.

例子

var chart = c3.generate({
bindto: '#chart',
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25]
]
}
});

例子:

https://c3js.org/examples.html

https://github.com/c3js/c3/tree/master/htdocs/samples

D3

https://d3js.org/

D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG, and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.

例子:

https://github.com/d3/d3/wiki/Gallery

https://www.d3-graph-gallery.com/wordcloud.html

react图工具集成的更多相关文章

  1. 利用AE编写切图工具的一些探讨

    文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/. 1.前言 这周利用晚上在家时间研究了下如何使用AE来开发切图工具.最初 ...

  2. MindMup 是一个开源的、在线的、简单的思维导图工具

    MindMup是一个开源.在线的思维导图工具:它有以下特点: 开源 在线 导图可存放在网站(公有,要是在不同的终端浏览的话需要记住导图的网址)或google driver(私有),无用户名密码 很方便 ...

  3. React Native 轻松集成分享功能(iOS 篇)

    产品一直催我在 RN 项目中添加分享功能,一直没找到合适的库,今天让我看到了一个插件分享给大家. 在集成插件之前,需要在各大开放平台上成功注册应用,并通过审核(支持 3 个可选的主流平台).支持的平台 ...

  4. React Native 轻松集成统计功能(Android 篇)

    关于推送的集成请参考这篇文章,本篇文章将引导你集成统计功能,只需要简单的三个步骤就可以集成统计功能. 第一步 安装 在你的项目路径下执行命令: npm install janalytics-react ...

  5. React Native 轻松集成分享功能(Android 篇)

    关于推送的集成请参考这篇文章,关于统计的集成请参考这篇文章,本篇文章将引导你集成分享功能. 在集成插件之前,需要在各大开放平台上成功注册应用,并通过审核(支持 3 个可选的主流平台).支持的平台如下: ...

  6. React Native 轻松集成统计功能(iOS 篇)

    最近产品让我加上数据统计功能,刚好极光官方支持数据统计 支持了 React Native 版本 第一步 安装: 在你的项目路径下执行命令: npm install janalytics-react-n ...

  7. 思维导图工具XMind

    思维导图工具XMind XMind简单介绍 官网地址:https://www.xmind.cn/ XMind 是一个全功能的思维导图和头脑风暴软件,为激发灵感和创意而生.作为一款有效提升工作和生活效率 ...

  8. Cutterman - 最好用的切图工具

    Cutterman - 最好用的切图工具 http://www.cutterman.cn/zh/cutterman

  9. 画时序图工具TimingDesigner 9.2 安装指导

    画时序图工具TimingDesigner 9.2 安装指导 先上文件下载链接:http://bbs.eetop.cn/viewthread.php?tid=250446&;highlight= ...

随机推荐

  1. 【Spring Cloud笔记】 Eureka通过集群实现高可用

    Eureka实现服务注册与发现,在Spring Cloud微服务中起着关键性的作用,必须保障其高可用,常规方案无非通过集群实现.这里在本地机器搭建一个伪集群环境,通过两个节点实现相互注册,并通过主备数 ...

  2. iBatis第四章:动态SQL的用法

    一.什么是动态SQL,以及使用动态SQL的好处 所谓动态SQL,是针对静态SQL而言的,静态SQL的SQL语句是固定的,使用动态SQL是为了增强SQL的灵活性和复用性,可以用一个动态SQL达到在不同条 ...

  3. delphi中WMI的使用(网卡是否接入)

    WMI(Windows Management Instrumentation,Windows 管理规范)是一项核心的 Windows 管理技术:用户可以使用 WMI 管理本地和远程计算机. 通过使用W ...

  4. w3wp.exe进程占用内存过高解决方法

    解决CPU占用过多: 1.在IIS中对每个网站进行单独的应用程序池配置.即互相之间不影响. 2.设置应用程序池的CPU监视,不超过25%(服务器为4CPU),每分钟刷新,超过限制时关闭. 根据w3wp ...

  5. ORM(二)常用字段小记

    常用字段类型: AutoField:字段自增,多用于ID主键字段,每个表中只能有一个AutoField字段类型. id = models.AutoField(primary_key=True) # 设 ...

  6. Pycharm安装并配置jupyter notebook

    Pycharm安装并配置jupyter notebook Pycharm安装并配置jupyter notebook 一: 安装命令jupyter: pip install jupyter 如果缺少依赖 ...

  7. JavaScript match()方法和正则表达式match()

    先介绍参数为普通字符串的使用方式,此时match方法的返回值是存放首次匹配内容的数组.如果没有找到匹配结果,返回null.语法结构: 1 str.match(searchvalue)参数解析:(1). ...

  8. remote: Permission to user_name/Code.git denied to other_user_name. fatal: unable to access 'https://github.com/user_name/Code.git/': The requested URL returned error: 403

    Error msg: $ git push remote: Permission to xxx/Code.git denied to xxxxxx. fatal: unable to access ' ...

  9. Fum uc M-R ko P's R

    Milr-Rabin Dodod Avlo se \(n-1\) e \(u\cdot 2^t\). hen goch'n Toizz lme \([1,n-1]\) e \(l\). cak fe ...

  10. VSCode python 遇到的问题:vscode can't open file '<unprintable file name>': [Errno 2] No such file or directory

    代码很简单,就两行: import pandas as pd import netCDF4 as nc dataset = nc.Dataset('20150101.nc') 环境:在VSCode中左 ...