chartjs-chart-treemap 4.2.2 → 5.0.0-next.10

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
@@ -10,11 +10,51 @@
10
10
  [![documentation](https://img.shields.io/static/v1?message=Documentation&color=informational)](https://chartjs-chart-treemap.pages.dev)
11
11
  ![GitHub](https://img.shields.io/github/license/kurkle/chartjs-chart-treemap.svg)
12
12
 
13
+ chartjs-chart-treemap adds a `treemap` chart type to Chart.js that displays hierarchical (tree-structured) data as a set of nested rectangles, where each rectangle's area is proportional to the value it represents. It's for visualizing part-to-whole or hierarchical data — disk usage, sales by category, org structures — in less space than a bar or pie chart would need.
14
+
15
+ ## Example
16
+
13
17
  ![TreeMap Example Image](treemap.png)
14
18
 
19
+ ## Installation
20
+
21
+ ```bash
22
+ npm install chartjs-chart-treemap
23
+ ```
24
+
25
+ Or via CDN:
26
+
27
+ ```html
28
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
29
+ <script src="https://cdn.jsdelivr.net/npm/chartjs-chart-treemap"></script>
30
+ ```
31
+
32
+ ## Quickstart
33
+
34
+ ```js
35
+ import { Chart, registerables } from 'chart.js';
36
+ import { TreemapController, TreemapElement } from 'chartjs-chart-treemap';
37
+
38
+ Chart.register(...registerables, TreemapController, TreemapElement);
39
+
40
+ new Chart(document.getElementById('chart'), {
41
+ type: 'treemap',
42
+ data: {
43
+ datasets: [
44
+ {
45
+ tree: [6, 6, 4, 3, 2, 2, 1],
46
+ backgroundColor: 'rgba(54, 162, 235, 0.6)',
47
+ },
48
+ ],
49
+ },
50
+ });
51
+ ```
52
+
53
+ See more integration options (script tag, other module loaders) in the [documentation](https://chartjs-chart-treemap.pages.dev/integration).
54
+
15
55
  ## Documentation
16
56
 
17
- You can find documentation for chartjs-chart-treemap at [https://chartjs-chart-treemap.pages.dev/](https://chartjs-chart-treemap.pages.dev/).
57
+ Full documentation, including the dataset and options reference, is at [https://chartjs-chart-treemap.pages.dev/](https://chartjs-chart-treemap.pages.dev/).
18
58
 
19
59
  ## Development
20
60