AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
재사용 가능한 D3.js 컴포넌트 기반 차트 라이브러리
Composable Charting Library based on reusable D3.js components.
개발 도구TypeScript · JavaScriptGitHub @britecharts직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Finished, accessible charts that any page, and any agent, can add with one script tag or one validated JSON config.
Britecharts is a library of finished D3.js charts: bar, line, donut, stacked and grouped bar, stacked area, scatter plot, heatmap, sparkline, bullet and brush, plus a tooltip and a legend. You choose a chart, give it data and a few settings, and get a polished, interactive, accessible chart that works the same in plain HTML, any framework or React.
Grammar libraries hand you scales, marks and axes to assemble. Britecharts hands you a bar chart. Every chart shares one vocabulary (width, colorSchema, isLoading, numberFormat, exportChart, a11yTitle) and comes with loading and empty states, animation, tooltips and export already built. There are fewer ways to go wrong, for people and for coding agents alike.
Every chart is accessible without any setup:
Commercial libraries charge per seat for this set. In Britecharts it is on by default, and each part can be turned off.
The vanilla core runs anywhere: a server-rendered template, a static site, a Web Component, or an AI sandbox that only allows CDN scripts. The same chart is available as a framework-agnostic wrapper and as a React component. And because a chart is a name, a configuration and data, it can be written down as a JSON spec that a schema checks before it's drawn.
Agents write Britecharts correctly on the first try more often when the library helps them:
@britecharts/core, with each chart's data shape, accessors and common traps.height?" and a link to the chart's API page, and a value of the wrong type says what it should be.Version 3 is a rewrite of Britecharts in TypeScript, on D3 v7, as three packages: @britecharts/core, @britecharts/wrappers and @britecharts/react.
--bc-* custom property, and the charts follow the page's color-scheme through light-dark().exportChart('chart.svg').Coming from version 2? Read the migration guide.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@britecharts/core/dist/styles/bundle/britecharts.min.css" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/d3-selection.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@britecharts/core/dist/cdn/bundle/core.cdn.min.js"></script>
<div class="bar-container"></div>
<script>
const barChart = core.bar().height(300).a11yTitle('Signups by plan');
d3.select('.bar-container')
.datum([
{ name: 'Pro', value: 412 },
{ name: 'Team', value: 236 },
{ name: 'Free', value: 1200 },
])
.call(barChart);
</script>
npm install @britecharts/core d3-selection
import { select } from 'd3-selection';
import { bar } from '@britecharts/core';
import '@britecharts/core/dist/styles/bundle/britecharts.min.css';
const barChart = bar().isHorizontal(true).height(300).a11yTitle('Signups by plan');
select('.bar-container').datum(data).call(barChart);
npm install @britecharts/react
import { Bar } from '@britecharts/react';
<Bar data={data} isHorizontal a11yTitle="Signups by plan" />;
In an app set up with shadcn/ui, one command adds a chart that follows your theme and its dark mode, with one registry item per chart:
npx shadcn@latest add https://britecharts.github.io/britecharts/r/bar-chart.json
To use Britecharts with another framework, use the create, update and destroy methods of the wrappers package. For Angular, check out ngx-britecharts.
{
"$schema": "https://britecharts.github.io/britecharts/schema/v3/bar.json",
"chart": "bar",
"config": { "isHorizontal": true, "a11yTitle": "Signups by plan" },
"data": [{ "name": "Pro", "value": 412 }]
}
Editors validate and complete it from the schema, and BarWrapper.create(element, spec.data, spec.config) draws it.
Every chart shares the common accessors (width, height, margin, colorSchema, isLoading, a11yTitle and so on) and adds its own:
Britecharts is built with the reusable chart pattern on plain D3.js code you can read, fork and modify, and every chart is covered by unit tests and by browser tests in real consumer apps. To customise the look, see Styling Britecharts.
This project is in active development. We want your input about what is important, for that, add your votes using the 👍 reaction:
Whether you're helping us fix bugs, improving the docs, or spreading the word, we'd love to have you as part of the Britecharts community!
To give your feedback, you can open a new issue. You can also find us in the D3.js slack group, in the #tool-britecharts channel. We are looking for contributors and committers, so if you want to become a part of this project, check the contributing guide for ideas on contributing and get started today!
Britecharts is dedicated to building a welcoming, diverse, and safe community. We expect everyone participating in the Britecharts community to abide by our Code of Conduct. Please read it and follow it.
Sun Dai designs Britecharts, and two books inspired the code, Developing a D3.js Edge and Mastering D3.js. It also leveraged a significant number of examples and articles from the D3.js community overall.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind are welcome!
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Read more in the license document