├── .husky
├── pre-push
├── pre-commit
└── commit-msg
├── mocha.opts
├── config
├── .lintstagedrc.json
├── const.json
├── template
│ ├── banner.cjs
│ ├── plugin.d.txt
│ └── banner.js
├── cjs.js
├── jsdoc
│ └── static
│ │ ├── analytics.js
│ │ └── doc.css
├── commitlint.config.cjs
├── jsdoc.js
├── commit.template
├── webpack
│ ├── packaged.cjs
│ ├── production.cjs
│ ├── development.cjs
│ ├── theme.cjs
│ └── plugin.cjs
├── type.d-plugin.js
├── deploy-nightly.sh
├── rollup
│ └── esm.js
├── deploy.sh
└── util.js
├── .npmrc
├── .yarnrc.yml
├── packages
└── react
│ ├── .storybook
│ ├── preview-head.html
│ ├── preview.cjs
│ └── main.cjs
│ ├── tsconfig.node.json
│ ├── vite.config.test.ts
│ ├── CHANGELOG.md
│ ├── .gitignore
│ ├── demo
│ ├── index.html
│ ├── main.tsx
│ └── App.tsx
│ ├── vitest.config.ts
│ ├── tsconfig.json
│ ├── LICENSE
│ ├── vite.config.ts
│ ├── stories
│ ├── assets
│ │ ├── direction.svg
│ │ ├── flow.svg
│ │ ├── code-brackets.svg
│ │ ├── comments.svg
│ │ ├── repo.svg
│ │ ├── plugin.svg
│ │ └── stackalt.svg
│ └── BillboardJS.stories.tsx
│ ├── src
│ └── index.tsx
│ ├── package.json
│ └── test
│ └── basic.test.ts
├── demo
├── data
│ ├── test.csv
│ ├── test2.csv
│ ├── string_x.csv
│ └── test.json
├── benchmark
│ ├── benchmark.css
│ └── index.html
├── assets
│ ├── data2.svg
│ ├── data1.svg
│ └── data3.svg
├── types
│ ├── index.html
│ └── types.css
└── themes
│ └── index.html
├── test
├── assets
│ ├── data
│ │ ├── test.csv
│ │ └── test.json
│ ├── module
│ │ ├── fake.ts
│ │ ├── browser.ts
│ │ └── util.ts
│ ├── config
│ │ └── classes.ts
│ └── common.css
├── esm
│ ├── line-spec.ts
│ ├── subchart-spec.ts
│ ├── scatter-spec.ts
│ ├── radar-spec.ts
│ ├── donut-spec.ts
│ └── esm-error-spec.ts
├── internals
│ ├── generator-spec.ts
│ ├── data-convert-spec.ts
│ └── class-spec.ts
├── api
│ ├── legend-spec.ts
│ └── x-spec.ts
├── shape
│ └── shape-spec.ts
└── plugin
│ ├── bubble-compare
│ └── bubble-compare-spec.ts
│ └── textoverlap
│ └── textoverlap-spec.ts
├── .gitattributes
├── .github
├── PULL_REQUEST_TEMPLATE.md
├── ISSUE_TEMPLATE.md
├── ISSUE_TEMPLATE
│ ├── question.md
│ ├── bug.md
│ └── feature_request.md
├── copilot-instructions.md
├── workflows
│ ├── nightly-build.yml
│ └── ci.yml
└── dependabot.yml
├── .editorconfig
├── .gitignore
├── types
├── tslint.json
├── plugin
│ ├── sparkline
│ │ ├── options.d.ts
│ │ └── index.d.ts
│ ├── bubblecompare
│ │ ├── options.d.ts
│ │ └── index.d.ts
│ ├── stanford
│ │ ├── index.d.ts
│ │ └── options.d.ts
│ ├── tableview
│ │ ├── index.d.ts
│ │ └── options.d.ts
│ ├── textoverlap
│ │ ├── index.d.ts
│ │ └── options.d.ts
│ └── plugin.d.ts
├── tsconfig.json
├── index.d.ts
├── types.d.ts
└── bb.d.ts
├── src
├── ChartInternal
│ ├── internals
│ │ ├── category.ts
│ │ ├── style.ts
│ │ ├── title.ts
│ │ └── format.ts
│ ├── data
│ │ └── IData.ts
│ └── shape
│ │ └── bubble.ts
├── index.ts
├── Chart
│ └── api
│ │ ├── color.ts
│ │ ├── group.ts
│ │ ├── category.ts
│ │ ├── legend.ts
│ │ └── x.ts
├── Plugin
│ ├── stanford
│ │ ├── classes.ts
│ │ └── util.ts
│ ├── sparkline
│ │ └── Options.ts
│ ├── bubblecompare
│ │ ├── Options.ts
│ │ └── index.ts
│ ├── tableview
│ │ └── const.ts
│ ├── Plugin.ts
│ ├── textoverlap
│ │ └── Options.ts
│ └── Plugin.js
├── index.esm.ts
├── config
│ ├── Store
│ │ ├── Store.ts
│ │ └── Element.ts
│ ├── Options
│ │ ├── shape
│ │ │ ├── scatter.ts
│ │ │ ├── bubble.ts
│ │ │ ├── funnel.ts
│ │ │ ├── spline.ts
│ │ │ ├── candlestick.ts
│ │ │ ├── line.ts
│ │ │ ├── treemap.ts
│ │ │ └── radar.ts
│ │ ├── Options.ts
│ │ ├── common
│ │ │ ├── boost.ts
│ │ │ └── title.ts
│ │ └── interaction
│ │ │ ├── interaction.ts
│ │ │ └── subchart.ts
│ ├── config.ts
│ ├── resolver
│ │ ├── axis.ts
│ │ └── interaction.ts
│ └── const.ts
└── module
│ ├── browser.ts
│ ├── error.ts
│ ├── generator.ts
│ ├── worker.ts
│ └── Cache.ts
├── tsconfig.json
├── .releaserc.json
├── LICENSE
├── jsdoc.json
├── .dprint.jsonc
├── DEVELOPMENT.md
├── vitest.config.ts
├── webpack.config.cjs
└── AUTHORS.txt
/.husky/pre-push:
--------------------------------------------------------------------------------
1 |
2 | npm run lint
3 |
--------------------------------------------------------------------------------
/mocha.opts:
--------------------------------------------------------------------------------
1 | --timeout 3500 --parallel
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | npm run format
2 | npm run lint-staged
3 |
--------------------------------------------------------------------------------
/config/.lintstagedrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "*.ts": "npm run lint"
3 | }
4 |
--------------------------------------------------------------------------------
/config/const.json:
--------------------------------------------------------------------------------
1 | {
2 | "pluginPrefix": "billboardjs-plugin"
3 | }
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | # https://docs.npmjs.com/using-npm/config
2 | package-lock=false
3 |
--------------------------------------------------------------------------------
/.yarnrc.yml:
--------------------------------------------------------------------------------
1 | nodeLinker: node-modules
2 | yarnPath: .yarn/releases/yarn-4.3.1.cjs
3 |
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 |
2 | npx --no-install commitlint -g ./config/commitlint.config.cjs --edit $1
3 |
--------------------------------------------------------------------------------
/packages/react/.storybook/preview-head.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/demo/data/test.csv:
--------------------------------------------------------------------------------
1 | data1,data2,data3
2 | 120,80,200
3 | 140,50,210
4 | 170,100,250
5 | 150,70,300
6 | 180,120,280
--------------------------------------------------------------------------------
/demo/data/test2.csv:
--------------------------------------------------------------------------------
1 | data1,data2,data3
2 | 20,180,400
3 | 40,150,310
4 | 70,120,470
5 | 50,170,400
6 | 80,200,380
--------------------------------------------------------------------------------
/demo/data/string_x.csv:
--------------------------------------------------------------------------------
1 | x,download,loading
2 | www.siteX.com,100,400
3 | www.siteY.com,200,100
4 | www.siteZ.com,300,200
5 |
--------------------------------------------------------------------------------
/test/assets/data/test.csv:
--------------------------------------------------------------------------------
1 | data1,data2,data3
2 | 120,80,200
3 | 140,50,210
4 | 170,100,250
5 | 150,70,300
6 | 180,120,280
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | .releaserc.json merge=ours
2 | .travis.yml merge=ours
3 | CHANGELOG.md merge=ours
4 | README.md merge=ours
5 |
--------------------------------------------------------------------------------
/demo/data/test.json:
--------------------------------------------------------------------------------
1 | {
2 | "data1": [220, 240, 270, 250, 280],
3 | "data2": [180, 150, 300, 70, 120],
4 | "data3": [200, 310, 150, 100, 180]
5 | }
6 |
--------------------------------------------------------------------------------
/test/assets/data/test.json:
--------------------------------------------------------------------------------
1 | {
2 | "data1": [220, 240, 270, 250, 280],
3 | "data2": [180, 150, 300, 70, 120],
4 | "data3": [200, 310, 150, 100, 180]
5 | }
6 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Issue
2 |
3 |
4 | ## Details
5 |
6 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Description
2 |
3 |
4 | ## Steps to check or reproduce
5 |
6 |
--------------------------------------------------------------------------------
/test/assets/module/fake.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | /* eslint-disable */
6 | // @ts-nocheck
7 | export const isTabVisible = 1;
8 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 | root = true
3 |
4 | [*.js]
5 | charset = utf-8
6 | end_of_line = lf
7 | indent_style = tab
8 | insert_final_newline = true
9 | max_line_length = 80
10 | trim_trailing_whitespace = true
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Question
3 | about: If has any question
4 | title: ''
5 | labels: question
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## Description
11 |
12 |
--------------------------------------------------------------------------------
/config/template/banner.cjs:
--------------------------------------------------------------------------------
1 | const {resolve} = require("path");
2 | const {execSync} = require("child_process");
3 |
4 | module.exports = JSON.parse(
5 | execSync(`node ${resolve(__dirname, "./banner.js")}`, {encoding: "utf-8"})
6 | );
7 |
--------------------------------------------------------------------------------
/packages/react/.storybook/preview.cjs:
--------------------------------------------------------------------------------
1 | export const parameters = {
2 | actions: { argTypesRegex: "^on[A-Z].*" },
3 | controls: {
4 | matchers: {
5 | color: /(background|color)$/i,
6 | date: /Date$/,
7 | },
8 | },
9 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | *.log
3 | *.iml
4 | package-lock.json
5 | .yarn/*
6 | /*.css
7 | /*.html
8 | /*.js
9 | /*.sh
10 | /.*
11 | /coverage
12 | /demo/work
13 | /dist*
14 | /doc
15 | /monitor
16 | /node_modules
17 | /test/**/__screenshots__
--------------------------------------------------------------------------------
/types/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "dtslint/dtslint.json",
3 | "rules": {
4 | "semicolon": true,
5 | "indent": [true, "tabs", 4],
6 | "jsdoc-format": false,
7 | "whitespace": [false, "check-module"]
8 | }
9 | }
--------------------------------------------------------------------------------
/config/template/plugin.d.txt:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | import PluginClass from "../../types/plugin/{=PLUGIN-NAME}";
6 |
7 | export default PluginClass;
8 |
--------------------------------------------------------------------------------
/test/assets/config/classes.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Test purpose to be consumed from module replacement: /src/module/util.ts
3 | */
4 | /* eslint-disable */
5 | // @ts-nocheck
6 | export * from "../../../src/config/classes";
7 | export {default} from "../../../src/config/classes";
--------------------------------------------------------------------------------
/config/cjs.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Generate a CJS package.json file to dist folder.
3 | */
4 | import {resolvePath, writeJson} from "./util.js";
5 |
6 | const content = {
7 | "type": "commonjs"
8 | };
9 |
10 | writeJson(resolvePath("../dist/package.json", false), content);
11 |
--------------------------------------------------------------------------------
/test/assets/module/browser.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Test purpose to be consumed from module replacement: /src/module/util.ts
3 | */
4 | /* eslint-disable */
5 | // @ts-nocheck
6 | export {window, document, requestAnimationFrame, requestIdleCallback} from "../../../src/module/browser";
7 |
--------------------------------------------------------------------------------
/packages/react/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "module": "ESNext",
5 | "moduleResolution": "Node",
6 | "allowSyntheticDefaultImports": true
7 | },
8 | "include": ["vite.config.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/packages/react/vite.config.test.ts:
--------------------------------------------------------------------------------
1 | import {defineConfig} from "vite";
2 | import react from "@vitejs/plugin-react";
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()],
7 | root: "demo",
8 | build: {
9 | emptyOutDir: true,
10 | outDir: "../dist"
11 | }
12 | });
13 |
--------------------------------------------------------------------------------
/types/plugin/sparkline/options.d.ts:
--------------------------------------------------------------------------------
1 | export interface SparklineOptions {
2 | /**
3 | * Specify sparkline charts holder selector.
4 | * - **NOTE:** The amount of holder should match with the amount of data. If has less, will append necessaray amount nodes as sibling of main chart.
5 | */
6 | selector: string;
7 | }
8 |
--------------------------------------------------------------------------------
/packages/react/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.0.1 (2023-02-06)
2 |
3 |
4 | ### Bug Fixes
5 |
6 | * **type:** Export options interface for react component (closes [#3077](https://github.com/naver/billboard.js/issues/3077)
7 | * **package:** Error in react package when option is passed as props (closes [#3075](https://github.com/naver/billboard.js/issues/3075)
8 |
--------------------------------------------------------------------------------
/demo/benchmark/benchmark.css:
--------------------------------------------------------------------------------
1 | h1 {margin: 10px 0}
2 | p {margin:5px 0}
3 | input, button, select {font-size:16px;}
4 | button{
5 | border:solid 1px #ccc;font-size: 1.1em;
6 | padding: 3px 8px;
7 | border-radius: 10px;
8 | }
9 | button:last-child {background-color: red;color:#fff}
10 | input[type=number] {width: 70px;}
11 | span {font-size: 12px;}
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug
3 | about: Create a report to help us improve
4 | title: "[Bug] "
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## Description
11 |
12 |
13 | ## Steps to check or reproduce
14 |
15 |
--------------------------------------------------------------------------------
/types/plugin/bubblecompare/options.d.ts:
--------------------------------------------------------------------------------
1 | export interface BubblecompareOptions {
2 | /**
3 | * Minimum bubble radius (px, default: 11)
4 | */
5 | minR?: number;
6 | /**
7 | * Maximum bubble radius (px, default: 11)
8 | */
9 | maxR?: number;
10 | /**
11 | * expand ratio when bubble focused (default: 1)
12 | */
13 | expandScale?: number;
14 | }
15 |
--------------------------------------------------------------------------------
/types/plugin/stanford/index.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | import {Plugin} from "../plugin";
6 | import {StanfordOptions} from "./options";
7 |
8 | export default class Stanford extends Plugin {
9 | /**
10 | * Generate stanford diagram
11 | */
12 | constructor(options: StanfordOptions);
13 | }
14 |
--------------------------------------------------------------------------------
/types/plugin/tableview/index.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | import {Plugin} from "../plugin";
6 | import {TableViewOptions} from "./options";
7 |
8 | export default class TableView extends Plugin {
9 | /**
10 | * Generate stanford diagram
11 | */
12 | constructor(options?: TableViewOptions);
13 | }
14 |
--------------------------------------------------------------------------------
/types/plugin/bubblecompare/index.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | import {Plugin} from "../plugin";
6 | import {BubblecompareOptions} from "./options";
7 |
8 | export default class Bubblecompare extends Plugin {
9 | /**
10 | * Generate stanford diagram
11 | */
12 | constructor(options: BubblecompareOptions);
13 | }
14 |
--------------------------------------------------------------------------------
/config/jsdoc/static/analytics.js:
--------------------------------------------------------------------------------
1 | // Google tag (gtag.js)
2 | var s = document.createElement("script");
3 | s.src = "https://www.googletagmanager.com/gtag/js?id=G-YHK0PNR1LP";
4 |
5 | document.head.appendChild(s);
6 |
7 | s.onload = function() {
8 | window.dataLayer = window.dataLayer || [];
9 | function gtag(){dataLayer.push(arguments);}
10 | gtag('js', new Date());
11 |
12 | gtag('config', 'G-YHK0PNR1LP');
13 | }
14 |
--------------------------------------------------------------------------------
/packages/react/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 | .*
15 |
16 | test/coverage
17 | test/__snapshots__
18 |
19 | # Editor directories and files
20 | .vscode/*
21 | !.vscode/extensions.json
22 | .idea
23 | .DS_Store
24 | *.suo
25 | *.ntvs*
26 | *.njsproj
27 | *.sln
28 | *.sw?
29 |
--------------------------------------------------------------------------------
/demo/assets/data2.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/ChartInternal/internals/category.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | export default {
6 | /**
7 | * Category Name
8 | * @param {number} i Index number
9 | * @returns {string} category Name
10 | * @private
11 | */
12 | categoryName(i: number): string {
13 | const {axis_x_categories} = this.config;
14 |
15 | return axis_x_categories?.[i] ?? i;
16 | }
17 | };
18 |
--------------------------------------------------------------------------------
/packages/react/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | @billboard.js/react
8 |
9 |
10 | @billboard.js/react
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/types/plugin/textoverlap/index.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | import {Plugin} from "../plugin";
6 | import {TextOverlapOptions} from "./options";
7 |
8 | export default class TextOverlap extends Plugin {
9 | /**
10 | * Prevents label overlap using [Voronoi layout](https://en.wikipedia.org/wiki/Voronoi_diagram).
11 | */
12 | constructor(options?: TextOverlapOptions);
13 | }
14 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard project is licensed under the MIT license
4 | */
5 | import * as interaction from "./config/resolver/interaction";
6 | import * as shape from "./config/resolver/shape";
7 |
8 | // extends shape modules
9 | Object.keys(shape)
10 | .forEach(v => shape[v]());
11 |
12 | // extends interaction modules
13 | Object.keys(interaction)
14 | .forEach(v => interaction[v]());
15 |
16 | export {bb, default} from "./core";
17 |
--------------------------------------------------------------------------------
/types/plugin/textoverlap/options.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | export interface TextOverlapOptions {
6 | /**
7 | * Set selector string for target text nodes
8 | */
9 | selector?: string;
10 |
11 | /**
12 | * Set extent of label overlap prevention
13 | */
14 | extent?: number;
15 |
16 | /**
17 | * Set minimum area needed to show a data label
18 | */
19 | area?: number;
20 | }
21 |
--------------------------------------------------------------------------------
/src/Chart/api/color.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | export default {
6 | /**
7 | * Get the color
8 | * @function color
9 | * @instance
10 | * @memberof Chart
11 | * @param {string} id id to get the color
12 | * @returns {string}
13 | * @example
14 | * chart.color("data1");
15 | */
16 | color(id: string): string {
17 | return this.internal.color(id); // more patterns
18 | }
19 | };
20 |
--------------------------------------------------------------------------------
/src/Plugin/stanford/classes.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | /**
6 | * CSS class names definition
7 | * @private
8 | */
9 | export default {
10 | colorScale: "bb-colorscale",
11 | stanfordElements: "bb-stanford-elements",
12 | stanfordLine: "bb-stanford-line",
13 | stanfordLines: "bb-stanford-lines",
14 | stanfordRegion: "bb-stanford-region",
15 | stanfordRegions: "bb-stanford-regions"
16 | };
17 |
--------------------------------------------------------------------------------
/.github/copilot-instructions.md:
--------------------------------------------------------------------------------
1 | # Copilot Guidelines
2 |
3 | ## Introduction
4 |
5 | These is contribution guidelines. Please also review our [Contributing Guideline](https://github.com/naver/billboard.js/blob/master/CONTRIBUTING.md).
6 |
7 | ## Linting
8 |
9 | Please review [eslint](https://github.com/naver/billboard.js/blob/master/eslint.config.js) configuration.
10 |
11 | ## Testing
12 |
13 | Basically we use vitest for testing framework and test files are located in `./test` directory.
14 |
15 |
--------------------------------------------------------------------------------
/config/commitlint.config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: ["@commitlint/config-conventional"],
3 |
4 | // https://github.com/conventional-changelog/commitlint/blob/master/docs/reference-rules.md
5 | rules: {
6 | "subject-case": [0],
7 | "type-enum": [
8 | 2,
9 | "always",
10 | [
11 | "feat",
12 | "fix",
13 | "docs",
14 | "style",
15 | "refactor",
16 | "test",
17 | "chore",
18 | "skip"
19 | ]
20 | ],
21 | "footer-max-line-length": [0]
22 | }
23 | };
24 |
--------------------------------------------------------------------------------
/test/assets/common.css:
--------------------------------------------------------------------------------
1 | .bb .bb-button, .bb text {
2 | font-size: 11px;
3 | }
4 |
5 | .hide {
6 | display: none;
7 | }
8 |
9 | #display_flex {
10 | display: flex;
11 | align-items: center;
12 | justify-content: center;
13 | }
14 |
15 | .regions_class1{
16 | fill: red;
17 | }
18 |
19 | .eval-text-size .bb-axis-x text {
20 | font-size: 20px;
21 | }
22 |
23 | .eval-text-size .bb-axis-y text {
24 | font-size: 35px;
25 | }
26 |
27 | .eval-text-size .bb-axis-y2 text {
28 | font-size: 30px;
29 | }
--------------------------------------------------------------------------------
/packages/react/.storybook/main.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "stories": [
3 | "../stories/**/*.stories.mdx",
4 | "../stories/**/*.stories.@(js|jsx|ts|tsx)"
5 | ],
6 | "addons": [
7 | "@storybook/addon-console",
8 | "@storybook/addon-links",
9 | "@storybook/addon-essentials",
10 | "@storybook/addon-interactions"
11 | ],
12 | "framework": "@storybook/react",
13 | "core": {
14 | "builder": "@storybook/builder-vite"
15 | },
16 | "features": {
17 | "storyStoreV7": true
18 | },
19 | "reactOptions": {
20 | "legacyRootApi": false
21 | }
22 | }
--------------------------------------------------------------------------------
/types/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "noImplicitAny": false,
5 | "noImplicitThis": true,
6 | "strictNullChecks": true,
7 | "strictFunctionTypes": false,
8 | "baseUrl": "../",
9 | "lib": [
10 | "es6", "dom"
11 | ],
12 | "typeRoots": [
13 | "./node_modules/@types"
14 | ]
15 | },
16 | "include": [
17 | "./*.ts"
18 | ],
19 | "noEmit": true,
20 | "forceConsistentCasingInFileNames": true
21 | }
22 |
--------------------------------------------------------------------------------
/packages/react/demo/main.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import App from "./App";
4 | // import "./index.css";
5 |
6 | const options = {
7 | data: {
8 | columns: [
9 | ["data1", 30, 200, 100, 400, 150, 250],
10 | ["data2", 50, 20, 10, 40, 15, 25],
11 | ],
12 | type: "area",
13 | empty: {
14 | label: {
15 | text: "No Data",
16 | },
17 | },
18 | }
19 | };
20 |
21 | ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
22 |
23 |
24 |
25 | );
26 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "ES2015",
4 | "moduleResolution": "node",
5 | "noImplicitAny": false,
6 | "noImplicitThis": false,
7 | "strictNullChecks": true,
8 | "strictFunctionTypes": false,
9 | "baseUrl": "../",
10 | "lib": [
11 | "es6", "dom"
12 | ]
13 | },
14 | "include": [
15 | "src/**/index*.ts",
16 | ],
17 | "exclude": [
18 | "test/**/*.ts"
19 | ],
20 | "noEmit": true,
21 | "forceConsistentCasingInFileNames": true,
22 | "types": [
23 | "@vitest/browser/providers/webdriverio",
24 | "@vitest/browser/providers/playwright"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/.releaserc.json:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "@semantic-release/commit-analyzer",
4 | ["@semantic-release/exec", {
5 | "prepareCmd": "cross-env VERSION=${nextRelease.version} npm run build"
6 | }],
7 | "@semantic-release/release-notes-generator",
8 | "@semantic-release/changelog",
9 | "@semantic-release/npm",
10 | ["@semantic-release/github", {
11 | "successComment": false,
12 | "releasedLabels": false
13 | }],
14 | "@semantic-release/git"
15 | ],
16 | "tagFormat": "${version}",
17 | "branches": [
18 | "latest",
19 | {
20 | "name": "next",
21 | "prerelease": true
22 | }
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/src/index.esm.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard project is licensed under the MIT license
4 | */
5 | // shape module
6 | export {
7 | area,
8 | areaLineRange,
9 | areaSpline,
10 | areaSplineRange,
11 | areaStep,
12 | areaStepRange,
13 | bar,
14 | bubble,
15 | candlestick,
16 | donut,
17 | funnel,
18 | gauge,
19 | line,
20 | pie,
21 | polar,
22 | radar,
23 | scatter,
24 | spline,
25 | step,
26 | treemap
27 | } from "./config/resolver/shape";
28 |
29 | // interaction module
30 | export {selection, subchart, zoom} from "./config/resolver/interaction";
31 |
32 | export {bb, default} from "./core";
33 |
--------------------------------------------------------------------------------
/config/jsdoc.js:
--------------------------------------------------------------------------------
1 | // for nightly build
2 | import {readJson, resolvePath} from "./util.js";
3 | import {exec} from "child_process";
4 | import {readFile, writeFile} from "fs";
5 |
6 | const pkg = readJson("package.json");
7 |
8 | exec("npm run jsdoc:cmd", () => {
9 | // Replace version info
10 | const file = resolvePath("../doc/bb.html");
11 |
12 | readFile(file, "utf8", (err, data) => {
13 | if (err) throw err;
14 |
15 | const result = data.replace(/__VERSION__/g, pkg.version);
16 |
17 | writeFile(file, result, "utf8", err => {
18 | if (err) throw err;
19 |
20 | console.log("==> API doc has been generated!");
21 | });
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/src/config/Store/Store.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | import Element from "./Element";
6 | import State from "./State";
7 |
8 | // mapping
9 | const classes = {
10 | element: Element,
11 | state: State
12 | };
13 |
14 | /**
15 | * Internal store class.
16 | * @class Store
17 | * @ignore
18 | * @private
19 | */
20 | export default class Store {
21 | constructor() {
22 | Object.keys(classes).forEach(v => {
23 | this[v] = new classes[v]();
24 | });
25 | }
26 |
27 | getStore(name: string): Element | State {
28 | return this[name];
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/demo/assets/data1.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/react/vitest.config.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | import {mergeConfig} from "vite";
4 | import {defineConfig} from "vitest/config";
5 | import viteConfig from "./vite.config";
6 |
7 | export default mergeConfig(viteConfig, defineConfig({
8 | root: "test",
9 | test: {
10 | testTimeout: 3_000,
11 | hookTimeout: 5_000,
12 | globals: true,
13 | coverage: {
14 | provider: "istanbul",
15 | reporter: ["text-summary", "html", "lcovonly"],
16 | enabled: true,
17 | include: [
18 | "src/**/**",
19 | ],
20 | extension: ["ts"]
21 | }
22 | }
23 | }));
24 |
--------------------------------------------------------------------------------
/packages/react/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "include": ["src/index.tsx"],
3 |
4 | "compilerOptions": {
5 | "target": "ESNext",
6 | "useDefineForClassFields": true,
7 | "lib": ["DOM", "DOM.Iterable", "ESNext"],
8 | "allowJs": false,
9 | "skipLibCheck": true,
10 | "esModuleInterop": false,
11 | "allowSyntheticDefaultImports": true,
12 | "strict": true,
13 | "forceConsistentCasingInFileNames": true,
14 | "module": "ESNext",
15 | "moduleResolution": "Node",
16 | "resolveJsonModule": true,
17 | "isolatedModules": true,
18 | "jsx": "react-jsx",
19 | "declaration": true,
20 | "outDir": "dist/types"
21 | },
22 | "references": [{
23 | "path": "./tsconfig.node.json"
24 | }]
25 | }
26 |
--------------------------------------------------------------------------------
/demo/assets/data3.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: "[Feature] "
5 | labels: feature, request
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/demo/types/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | billboard.js - Supported Chart Types
8 |
9 |
10 |
11 |
12 |
13 | Supported Chart Types
14 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/types/index.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2017 ~ present NAVER Corp.
3 | * billboard.js project is licensed under the MIT license
4 | */
5 | import {bb} from "./bb";
6 |
7 | export default bb;
8 | export as namespace bb;
9 | export {
10 | bb,
11 |
12 | // shapes modules
13 | area,
14 | areaLineRange,
15 | areaSpline,
16 | areaSplineRange,
17 | areaStep,
18 | areaStepRange,
19 | bar,
20 | bubble,
21 | candlestick,
22 | donut,
23 | funnel,
24 | gauge,
25 | line,
26 | pie,
27 | polar,
28 | radar,
29 | scatter,
30 | spline,
31 | step,
32 | treemap,
33 |
34 | // interaction modules
35 | selection,
36 | subchart,
37 | zoom
38 | } from "./bb";
39 | export * from "./axis";
40 | export * from "./chart";
41 | export * from "./options";
42 | export * from "./types";
43 |
--------------------------------------------------------------------------------
/config/commit.template:
--------------------------------------------------------------------------------
1 | ========== Commit Format ==========
2 | ():
3 |