rough-charts

? A responsive, composable react charting library with a hand-drawn style.

Github星跟踪图

Rough Charts · license build status

A responsive, composable react charting library with a hand-drawn style.
See Examples From StoryBooks.

Overview

Features

  • It's responsive.
  • It's flexible and easy to compose. You can compose all available ChartSeries Components and render any shapes you like.
  • It's lovely.
  • It's written in TypeScript.

Installation

  yarn add rough-charts

This project contains a package called react-roughjs. It has a lot of basic rough shapes, you may need it.

Usage

import * as React from 'react'
import {
  LineSeries, Tooltip,
  ChartProvider, XAxis, YAxis,
} from 'rough-charts'
import { colors } from './colors'

const data = [
  { name: 'A', value1: 30, value2: 35 },
  { name: 'B', value1: 90, value2: 17 },
  { name: 'C', value1: 50, value2: 23 },
  { name: 'D', value1: 40, value2: 15 },
  { name: 'E', value1: 70, value2: 39 },
  { name: 'G', value1: 30, value2: 25 },
  { name: 'H', value1: 100, value2: 31 },
  { name: 'I', value1: 110, value2: 32 },
]

const App = props => (
  <ChartProvider
    height={400}
    data={data}
  >
    <XAxis dataKey="name" />
    <YAxis />
    <LineSeries
      dataKey="value1"
      options={{
        stroke: colors[0],
        strokeWidth: 2,
      }}
    />
    <LineSeries
      dataKey="value2"
      options={{
        stroke: colors[3],
        strokeWidth: 2,
      }}
    />
    <Tooltip />
  </ChartProvider>
)

Fonts

Add your favorite hand-drawn style fonts:

<link href="https://fonts.googleapis.com/css?family=Patrick+Hand&display=swap" rel="stylesheet">
<style>
  * {
    font-family: 'Patrick Hand', cursive;
    font-size: 16px;
  }
</style>

Credits

This project was built on top of d3 and roughjs.

主要指标

概览
名称与所有者beizhedenglong/rough-charts
主编程语言TypeScript
编程语言TypeScript (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2019-10-04 05:19:54
推送于2020-11-03 17:52:46
最后一次提交2020-11-04 01:48:12
发布数13
最新版本名称rough-charts@0.5.0 (发布于 2020-05-24 00:55:57)
第一版名称react-roughjs@0.0.3 (发布于 2019-10-04 13:25:16)
用户参与
星数1.5k
关注者数17
派生数57
提交数64
已启用问题?
问题数8
打开的问题数1
拉请求数6
打开的拉请求数0
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?