bezel-charts 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  [![Python](https://github.com/ShazMoghaddam/bezel-charts/actions/workflows/python.yml/badge.svg)](https://github.com/ShazMoghaddam/bezel-charts/actions/workflows/python.yml)
10
10
  [![MIT licence](https://img.shields.io/badge/licence-MIT-D99A0E)](LICENSE)
11
11
 
12
- Bezel Charts is a set of free, open-source web components: thirteen chart tiles drawn in pure SVG, so they stay sharp on a phone, a 4K screen or a printed report. Build one in the Studio, paste one line of HTML into any site, or save any chart as a static SVG for a README, Notion page or slide, where JavaScript can't run.
12
+ Bezel Charts is a set of free, open-source web components: fourteen chart tiles drawn in pure SVG, so they stay sharp on a phone, a 4K screen or a printed report. Build one in the Studio, paste one line of HTML into any site, or save any chart as a static SVG for a README, Notion page or slide, where JavaScript can't run.
13
13
 
14
14
  ![Bezel Charts: a sparkline, rings, a gauge, a line chart with a launch day note, a donut, a bar chart with a target, a scatter plot with a trend line and a year-long activity heatmap, in light and dark tiles](docs/bezel-charts.png)
15
15
 
@@ -20,7 +20,7 @@ Bezel Charts is a set of free, open-source web components: thirteen chart tiles
20
20
  - **Made for READMEs.** Every chart exports as a clean static SVG, so a GitHub README can show a real chart.
21
21
  - **Data science friendly.** Scatter plots with a least-squares trend line and Pearson's r, grouped series, goal lines and notes on key points.
22
22
  - **Speaks your language.** Numbers and dates follow any locale, including Persian.
23
- - **Light.** About 20 kB gzipped for all thirteen charts, or 7 to 10 kB for a page that loads just one. No dependencies and no build step.
23
+ - **Light.** About 22 kB gzipped for all fourteen charts, or 7 to 11 kB for a page that loads just one. No dependencies and no build step.
24
24
  - **Accessible.** Tab to any chart and step through its values with the arrow keys. Screen readers hear each value and get a hidden table of the data. Dashes, shapes and patterns tell series apart without relying on colour, and animation respects reduced-motion settings.
25
25
  - **Python too.** `pip install bezel-charts` draws the same charts straight from a pandas DataFrame, for notebooks, reports and READMEs.
26
26
 
@@ -49,7 +49,7 @@ A sibling of [Bezel](https://github.com/ShazMoghaddam/bezel), the clock, calenda
49
49
  <bezel-bars heading="Commits this week" values="4,9,6,3,8,5,3" labels="M,T,W,T,F,S,S" stat="total"></bezel-bars>
50
50
  ```
51
51
 
52
- `@1` always loads the latest 1.x release, so you get fixes without changing anything. To pin an exact version, use `@v1.6.0` instead.
52
+ `@1` always loads the latest 1.x release, so you get fixes without changing anything. To pin an exact version, use `@v1.7.0` instead.
53
53
 
54
54
  That's all. Charts fill the width of whatever they sit in and redraw when it changes, so they work in a sidebar, a card grid or a full-width section without extra CSS.
55
55
 
@@ -85,8 +85,9 @@ import { toSVG } from 'bezel-charts/line'; // render and toSVG work for every ch
85
85
  | --- | --- |
86
86
  | One sparkline, ring, donut, gauge, progress bar or heatmap | 7.2 to 7.4 kB |
87
87
  | One line, area, histogram, box plot, scatter or bar chart | 9.4 to 10.4 kB |
88
+ | One bars-and-line combo | 11.1 kB |
88
89
  | A line and a bar chart | 12.6 kB |
89
- | Every chart: the full bundle | 20.4 kB |
90
+ | Every chart: the full bundle | 22.1 kB |
90
91
 
91
92
  Once a page needs four or five different charts, load the full bundle instead. `<bezel-chart type="…">` works with whichever charts are loaded, and tells you which file to add if its type isn't one of them. The classic `iife.js` script always has every chart, because a classic script can't load the shared file.
92
93
 
@@ -219,6 +220,30 @@ Stacked bars put positive parts above zero and negative parts below it. The tool
219
220
 
220
221
  Without `angle-labels`, labels that don't fit take turns, so only every few are shown. With it, they lean at 40 degrees and every one shows, shortened after 24 characters. The tooltip always has the full label.
221
222
 
223
+ ### `<bezel-combo>`
224
+
225
+ Bars and lines with different units on one chart, such as sales in pounds as bars and conversion in percent as a line. Bars read against the left axis and lines against the right.
226
+
227
+ ```html
228
+ <bezel-combo heading="Sales and conversion" values="182,214,236,268" line="3.1,3.4,3.6,4.2"
229
+ series="Sales" line-series="Conversion" labels="Q1,Q2,Q3,Q4" prefix="£" suffix="k" line-suffix="%"></bezel-combo>
230
+ ```
231
+
232
+ | Attribute | Values | Default |
233
+ | --------------- | ------------------------------------------------------------- | ------- |
234
+ | `values` | bar numbers, series separated by `\|` | |
235
+ | `line` | line numbers, lines separated by `\|` | |
236
+ | `series`, `line-series` | names for the bars and the lines | |
237
+ | `labels` | one per column, along the bottom | |
238
+ | `stacked` | with several bar series, pile them up | side by side |
239
+ | `line-prefix`, `line-suffix`, `line-decimals` | number formatting for the right axis and the line values | |
240
+ | `y-label`, `line-label` | titles above the left and right axes | |
241
+ | `line-zero` | boolean, start the right axis at zero | off |
242
+ | `dash`, `markers`, `patterns` | styles for the lines and the bars | off |
243
+ | `height` | chart height in px | `200` |
244
+
245
+ Two scales on one chart are easy to misread, so the right axis always has the same number of steps as the left: every gridline reads on both sides. A rule down each side takes its data's colour, so it's clear which axis belongs to what. The bar axis always includes zero; the line axis fits its data unless you add `line-zero`. The tooltip gives every value in its own units, with the total when stacked.
246
+
222
247
  ### `<bezel-histogram>`
223
248
 
224
249
  How raw values spread out. Give it the values themselves, such as 500 customers' ages, and it counts how many fall into each range. The ranges get round edges (20, 30, 40, not 19.7, 31.4) and a sensible number for the amount of data.
@@ -488,7 +513,7 @@ bc.line(df, x="month", y=["sales", "costs"], heading="Sales", prefix="£")
488
513
  bc.spark(df["signups"], heading="Signups").save("docs/signups.svg")
489
514
  ```
490
515
 
491
- All thirteen charts are available, and the Python output matches the JavaScript byte for byte, checked in CI. `chart.alt` gives ready-made alt text for the saved image. See the [Python README](python/README.md).
516
+ All fourteen charts are available, and the Python output matches the JavaScript byte for byte, checked in CI. `chart.alt` gives ready-made alt text for the saved image. See the [Python README](python/README.md).
492
517
 
493
518
  ## Frameworks
494
519
 
@@ -533,7 +558,7 @@ docs/ the README image and social preview, with the pages that render t
533
558
  test/ node:test suites, plus a Playwright browser test
534
559
  ```
535
560
 
536
- Each chart is a pure function that takes its options and a theme and returns an SVG string, which keeps them easy to test and lets the same code run in Node. The full bundle has a 22 kB gzip budget and each chart file its own, checked in CI by `npm run size`. See [CONTRIBUTING.md](CONTRIBUTING.md).
561
+ Each chart is a pure function that takes its options and a theme and returns an SVG string, which keeps them easy to test and lets the same code run in Node. The full bundle has a 24 kB gzip budget and each chart file its own, checked in CI by `npm run size`. See [CONTRIBUTING.md](CONTRIBUTING.md).
537
562
 
538
563
  ## Security
539
564