naver/billboard.js là dự án TypeScript với 6.0k sao trong nhóm Image Tools. 📊 Re-usable, easy interface JavaScript chart library based on D3.js, with SVG and Canvas rendering support
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
billboard.js is a re-usable, easy interface JavaScript chart library based on D3.js, with SVG and Canvas rendering support.
The name "billboard" comes from the famous billboard chart which everybody knows.
Why we decided to start billboard.js?
Documents
API Documentation
Examples
Roadmap
Contribution Guide
Development Guide
Comparison table with other libraries
Migration guide from C3.js
Third Party Applications
Who's using billboard.js
Benchmark
Technicals:
How to bundle for legacy browsers?
How to generate chart image in Node.js environment?
find out more at Wiki page.
v2 updates:
v2 CHANGELOG
Migration Guide to v2
v3 updates:
billboard.js 3.0 release: D3.js v6 support & new candlestick type!
v4 updates:
v4 CHANGELOG
Canvas rendering mode
Questions?
If you have any questions, check out the previous posts or create a new one at:
Stack Overflow: billboard.js tagged posts
Issue with 'question' label
Supported chart types
[!NOTE]
v4 adds an opt-in canvas rendering mode for high-density axis charts. See the
Canvas rendering mode notes for supported chart types,
ESM import usage, interactions and SVG parity scope.
Download and Installation
Download dist files from the repo directly or install it with pnpm.
Dist file list from the repo. (click to expand)
For development (Uncompressed)
You can download the uncompressed files for development
# Run install command from shell
$ pnpm add git+https://github.com/naver/billboard.js.git#nightly
Next (Release Candidate) version
Next version is the 'release candidate' build, prior to the latest official release.
# Run install command from shell
$ pnpm add billboard.js@next
Installation with pnpm
$ pnpm add billboard.js
React
The React component is available from the billboard.js/react subpath. The billboard namespace is
passed in through the bb prop, so importing the React subpath never pulls the root bundle into a
non-React bundle.
Without a bundler, load dist/billboard.react.js. It is a UMD build exposing the BillboardReact
global, which holds the component as both .Chart and .default:
<!-- React first: this path reads the 'React' global, so it needs a UMD build of
React. React 18 and below ship one; React 19 does not. -->
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<link rel="stylesheet" href="$YOUR_PATH/billboard.css">
<script src="$YOUR_PATH/billboard.pkgd.js"></script>
<script src="$YOUR_PATH/billboard.react.js"></script>
<div id="root"></div>
<script>
const {Chart} = BillboardReact;
ReactDOM.createRoot(document.getElementById("root")).render(
React.createElement(Chart, {
bb,
options: {
data: {
columns: [["data1", 30, 120, 80]],
type: "line"
}
}
})
);
</script>
[!NOTE]
billboard.react.js treats react as an external, so React must already be on the page. It
does not bundle billboard.js either — load billboard.js/billboard.pkgd.js first and hand
the bb global to the component.
On React 19+ there is no UMD build of React to load. Use a bundler, or import both packages
as ESM in the browser through an import map.
The packaged build registers every chart type, so string types (type: "line") work as-is. With
the ESM entry, pass the module instead (type: line()) or through the type prop.
For local visual testing of the React component, run:
$ pnpm run storybook
To verify the Storybook bundle, run:
$ pnpm run build:storybook
Using CDN
If you want to use 'billboard.js' without installation, load files directly from one of the CDN providers.
Basically will work on all SVG and ES6+ supported browsers.
Canvas rendering mode additionally requires browser Canvas 2D API support.
*Notes for legacy browsers:
Recommended to use the packaged build or construct your own build following How to bundle for legacy browsers? instructions.
D3.js has dropped support for legacy browsers since v6.
Support isn't fully guaranteed.
Dependency by version
D3.js (required)
billboard.js
4.x ~ 5.x
1.x ~ 2.x
6.x+
3.x+
Getting Started
Load billboard.js after D3.js.
<!-- 1) Load D3.js and billboard.js separately -->
<!-- Load D3: -->
<script src="https://d3js.org/d3.v6.min.js"></script>
<!-- Load billboard.js with base(or theme) style -->
<link rel="stylesheet" href="$YOUR_PATH/billboard.css">
<script src="$YOUR_PATH/billboard.js"></script>
<!-- 2) or Load billboard.js packaged with D3.js -->
<link rel="stylesheet" href="$YOUR_PATH/billboard.css">
<script src="$YOUR_PATH/billboard.pkgd.js"></script>
<!-- 3) optionally, the React component on top of either of the above.
Needs the 'React' global, so load a UMD build of React first
(React 18 and below ship one; React 19 does not). -->
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="$YOUR_PATH/billboard.react.js"></script>
Loading billboard.js exposes the bb global, and billboard.react.js exposes BillboardReact.
See React for a full example.
or by importing ESM.
[!TIP]
📌 Also check: How to load as ESM directly from the browser?
// 1) import billboard.js
// as named import with desired shapes and interaction modules
// https://github.com/naver/billboard.js/wiki/CHANGELOG-v2#modularization-by-its-functionality
import {bb, area, bar, zoom} from "billboard.js";
// or as importing default
import bb, {area, bar, zoom} from "billboard.js";
// 2) import css if your dev-env supports. If don't, include them via <link>
import "billboard.js/dist/billboard.css";
// or theme style. Find more themes from 'theme' folder
import "billboard.js/dist/theme/insight.css"
For canvas rendering mode, import from the /canvas ESM entry and set render.mode with
canvas().
For migration from C3.js, check out the migration guide.
If you have an issue bundling for legacy browsers, check out "How to bundle for legacy browsers?".
Basic usage example
1) Create chart holder element
<div id="chart"></div>
2) Generate a chart with options
// generate the chart
var chart = bb.generate({
bindto: "#chart",
data: {
// for ESM import usage, import 'line' module and execute it as
// type: line(),
type: "line",
columns: [
["data1", 30, 200, 100, 400, 150, 250]
]
},
zoom: {
// for ESM import usage, import 'zoom' module and execute it as
// enabled: zoom()
enabled: true
}
});
// call some API
chart.load( ... );
License
billboard.js is released under the MIT license.
Copyright (c) 2017 ~ present NAVER Corp.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/naver/billboard.js là nguồn chính thức.
naver/billboard.js có những chủ đề gì?
GitHub topics của naver/billboard.js: "canvas", "charting-library", "d3", "data-visualizations", "graph", "svg". TopGit xếp repo vào nhóm Image Tools.
naver/billboard.js có phải mã nguồn mở không?
Có — naver/billboard.js phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/naver/billboard.js.
naver/billboard.js có trang demo không?
Dự án có trang chủ ở https://naver.github.io/billboard.js/. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
naver/billboard.js còn đang phát triển không?
Commit gần nhất trên naver/billboard.js là 19 ngày trước (theo timestamp GitHub). Repo có 356 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
naver/billboard.js dùng license gì?
naver/billboard.js phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc billboard.js có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về billboard.js.