1.0.3 • Published 2 years ago

@vincecao/use-d3 v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

D3 Hooks

Hooks for integrating D3.js and Observablehq Notebook into your React Project.

npm version npm checks

HooksDescription
useD3Attach d3 function into a hook and render data-driven documents.
useD3NotebookEmbed notebook into a hook with Observablehq Runtime and Inspector.

This repo was initially inspired by following posts, but with enhancement and packaged as a reusable library

Installation

# Install latest package
# npm
npm i @vincecao/use-d3
# yarn
yarn add @vincecao/use-d3
# pnpm
pnpm i @vincecao/use-d3

This package is automatically published in NPMJS and GITHUB npm registry.

To install package from Github npm registry, add below file in your repo before run npm i or yarn add.

# .npmrc
@vincecao:registry=https://npm.pkg.github.com

You can also install directly from current repo master

# npm
npm i vincecao/use-d3
npm i github:vincecao/use-d3

# yarn
yarn add vincecao/use-d3
yarn add github:vincecao/use-d3

Live Demo

Development

# clone the repo
git clone https://github.com/vincecao/use-d3.git && cd use-d3

# install needed package for library
yarn

# local test library hooks
yarn start

# local test examples
cd example

# install needed package for library examples
yarn
# local test library examples
yarn start

# Now you can open example in localhost:1234

# build the demo example page
yarn build

cd ..
# build the @vincecao/use-d3 hooks library
yarn build
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.0

2 years ago