• Stars
    star
    1,516
  • Rank 30,787 (Top 0.7 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 5 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ“ˆ A responsive, composable react charting library with a hand-drawn style.

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

# NPM
npm install rough-charts

# Yarn 
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.

More Repositories

1

weird-fonts

𝑨 π‘±π’‚π’—π’‚π‘Ίπ’„π’“π’Šπ’‘π’• π’‘π’‚π’„π’Œπ’‚π’ˆπ’† 𝒕𝒉𝒂𝒕 𝒕𝒖𝒓𝒏 π’‚π’π’‘π’‰π’‚π’π’–π’Žπ’†π’“π’Šπ’„ 𝒄𝒉𝒂𝒓𝒂𝒄𝒕𝒆𝒓𝒔 π’Šπ’π’•π’ π’˜π’†π’Šπ’“π’… 𝒇𝒐𝒏𝒕 π’”π’•π’šπ’π’†.
TypeScript
609
star
2

react-hooks-lib

A set of reusable React Hooks.
JavaScript
540
star
3

vue-hooks-form

Building forms with vue composition API.
TypeScript
141
star
4

leetcode-site-generator

Generate your personal LeetCode website with one command!
JavaScript
103
star
5

reactablejs

A react high-order component for interact.js(drag and drop, resizing and multi-touch gestures).
TypeScript
62
star
6

react-multi-crops

A multiple cropping component for React
JavaScript
40
star
7

reason-hooks-lib

A set of reusable ReasonReact hooks.
Reason
32
star
8

reason-hooks-testing-library

ReasonML bindings for react-hooks-testing-library
Reason
25
star
9

reason-unstated

A simple reason react state management library that help you share hook state and logic easily.
OCaml
15
star
10

chrome-extension-starter-kit

Chrome Extension Starter Kit
JavaScript
13
star
11

reason-powerplug

πŸ”Œ Renderless Containers For ReasonReact
OCaml
11
star
12

nqm

npm with query
JavaScript
8
star
13

hooks-to-others

Transform react hooks into render props and high-order component patterns.
TypeScript
4
star
14

bookmark-search

A Chrome extension for searching bookmark quickly.
JavaScript
4
star
15

mac-look-up-log

Look up workflow for macOS
3
star
16

redux-and-react-redux

Simple Redux and React Redux implementation
JavaScript
3
star
17

js-lens

Safely accessing and updating nested object with functional features.
TypeScript
3
star
18

vue-reactivity

JavaScript
2
star
19

fusuma-imgs

1
star
20

mini-context-store

A react state management library using new context api
JavaScript
1
star
21

leetcode-solutions

Victor's LeetCode Website.
JavaScript
1
star
22

gatsby-starter-gcn

JavaScript
1
star
23

ant-design-snippets

An ant design snippets extension for VS Code.
1
star
24

safety-redux

Query and mutate Redux state safely.
JavaScript
1
star
25

beizhedenglong.github.io

beizhedenglong.github.io
HTML
1
star
26

rc-value

Make React component switch between Controlled Component and Uncontrolled Component easily.
JavaScript
1
star