@tectra-ng/charts 0.0.1 → 0.2.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.
Files changed (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -1
  3. package/bar-list/README.md +30 -0
  4. package/boxplot/README.md +62 -0
  5. package/bullet/README.md +53 -0
  6. package/candlestick/README.md +57 -0
  7. package/column/README.md +73 -0
  8. package/combo/README.md +83 -0
  9. package/core/README.md +62 -0
  10. package/fesm2022/tectra-ng-charts-bar-list.mjs +299 -0
  11. package/fesm2022/tectra-ng-charts-bar-list.mjs.map +1 -0
  12. package/fesm2022/tectra-ng-charts-boxplot.mjs +887 -0
  13. package/fesm2022/tectra-ng-charts-boxplot.mjs.map +1 -0
  14. package/fesm2022/tectra-ng-charts-bullet.mjs +666 -0
  15. package/fesm2022/tectra-ng-charts-bullet.mjs.map +1 -0
  16. package/fesm2022/tectra-ng-charts-candlestick.mjs +778 -0
  17. package/fesm2022/tectra-ng-charts-candlestick.mjs.map +1 -0
  18. package/fesm2022/tectra-ng-charts-column.mjs +1166 -0
  19. package/fesm2022/tectra-ng-charts-column.mjs.map +1 -0
  20. package/fesm2022/tectra-ng-charts-combo.mjs +1218 -0
  21. package/fesm2022/tectra-ng-charts-combo.mjs.map +1 -0
  22. package/fesm2022/tectra-ng-charts-core.mjs +3679 -0
  23. package/fesm2022/tectra-ng-charts-core.mjs.map +1 -0
  24. package/fesm2022/tectra-ng-charts-funnel.mjs +694 -0
  25. package/fesm2022/tectra-ng-charts-funnel.mjs.map +1 -0
  26. package/fesm2022/tectra-ng-charts-gantt.mjs +947 -0
  27. package/fesm2022/tectra-ng-charts-gantt.mjs.map +1 -0
  28. package/fesm2022/tectra-ng-charts-gauge.mjs +693 -0
  29. package/fesm2022/tectra-ng-charts-gauge.mjs.map +1 -0
  30. package/fesm2022/tectra-ng-charts-heatmap.mjs +935 -0
  31. package/fesm2022/tectra-ng-charts-heatmap.mjs.map +1 -0
  32. package/fesm2022/tectra-ng-charts-line.mjs +1541 -0
  33. package/fesm2022/tectra-ng-charts-line.mjs.map +1 -0
  34. package/fesm2022/tectra-ng-charts-org-chart.mjs +2341 -0
  35. package/fesm2022/tectra-ng-charts-org-chart.mjs.map +1 -0
  36. package/fesm2022/tectra-ng-charts-pie.mjs +1059 -0
  37. package/fesm2022/tectra-ng-charts-pie.mjs.map +1 -0
  38. package/fesm2022/tectra-ng-charts-radar.mjs +924 -0
  39. package/fesm2022/tectra-ng-charts-radar.mjs.map +1 -0
  40. package/fesm2022/tectra-ng-charts-radial-bar.mjs +802 -0
  41. package/fesm2022/tectra-ng-charts-radial-bar.mjs.map +1 -0
  42. package/fesm2022/tectra-ng-charts-range-area.mjs +933 -0
  43. package/fesm2022/tectra-ng-charts-range-area.mjs.map +1 -0
  44. package/fesm2022/tectra-ng-charts-rank-line.mjs +660 -0
  45. package/fesm2022/tectra-ng-charts-rank-line.mjs.map +1 -0
  46. package/fesm2022/tectra-ng-charts-sankey.mjs +837 -0
  47. package/fesm2022/tectra-ng-charts-sankey.mjs.map +1 -0
  48. package/fesm2022/tectra-ng-charts-scatter.mjs +1174 -0
  49. package/fesm2022/tectra-ng-charts-scatter.mjs.map +1 -0
  50. package/fesm2022/tectra-ng-charts-segmented-bar.mjs +328 -0
  51. package/fesm2022/tectra-ng-charts-segmented-bar.mjs.map +1 -0
  52. package/fesm2022/tectra-ng-charts-sunburst.mjs +733 -0
  53. package/fesm2022/tectra-ng-charts-sunburst.mjs.map +1 -0
  54. package/fesm2022/tectra-ng-charts-treemap.mjs +674 -0
  55. package/fesm2022/tectra-ng-charts-treemap.mjs.map +1 -0
  56. package/fesm2022/tectra-ng-charts-waterfall.mjs +809 -0
  57. package/fesm2022/tectra-ng-charts-waterfall.mjs.map +1 -0
  58. package/fesm2022/tectra-ng-charts.mjs +4 -0
  59. package/fesm2022/tectra-ng-charts.mjs.map +1 -0
  60. package/funnel/README.md +53 -0
  61. package/gantt/README.md +53 -0
  62. package/gauge/README.md +41 -0
  63. package/heatmap/README.md +47 -0
  64. package/line/README.md +86 -0
  65. package/org-chart/README.md +57 -0
  66. package/package.json +173 -4
  67. package/pie/README.md +66 -0
  68. package/radar/README.md +64 -0
  69. package/radial-bar/README.md +62 -0
  70. package/range-area/README.md +66 -0
  71. package/rank-line/README.md +51 -0
  72. package/sankey/README.md +52 -0
  73. package/scatter/README.md +71 -0
  74. package/segmented-bar/README.md +35 -0
  75. package/sunburst/README.md +55 -0
  76. package/treemap/README.md +47 -0
  77. package/types/tectra-ng-charts-bar-list.d.ts +724 -0
  78. package/types/tectra-ng-charts-bar-list.d.ts.map +1 -0
  79. package/types/tectra-ng-charts-boxplot.d.ts +882 -0
  80. package/types/tectra-ng-charts-boxplot.d.ts.map +1 -0
  81. package/types/tectra-ng-charts-bullet.d.ts +833 -0
  82. package/types/tectra-ng-charts-bullet.d.ts.map +1 -0
  83. package/types/tectra-ng-charts-candlestick.d.ts +854 -0
  84. package/types/tectra-ng-charts-candlestick.d.ts.map +1 -0
  85. package/types/tectra-ng-charts-column.d.ts +951 -0
  86. package/types/tectra-ng-charts-column.d.ts.map +1 -0
  87. package/types/tectra-ng-charts-combo.d.ts +987 -0
  88. package/types/tectra-ng-charts-combo.d.ts.map +1 -0
  89. package/types/tectra-ng-charts-core.d.ts +859 -0
  90. package/types/tectra-ng-charts-core.d.ts.map +1 -0
  91. package/types/tectra-ng-charts-funnel.d.ts +857 -0
  92. package/types/tectra-ng-charts-funnel.d.ts.map +1 -0
  93. package/types/tectra-ng-charts-gantt.d.ts +884 -0
  94. package/types/tectra-ng-charts-gantt.d.ts.map +1 -0
  95. package/types/tectra-ng-charts-gauge.d.ts +859 -0
  96. package/types/tectra-ng-charts-gauge.d.ts.map +1 -0
  97. package/types/tectra-ng-charts-heatmap.d.ts +914 -0
  98. package/types/tectra-ng-charts-heatmap.d.ts.map +1 -0
  99. package/types/tectra-ng-charts-line.d.ts +1023 -0
  100. package/types/tectra-ng-charts-line.d.ts.map +1 -0
  101. package/types/tectra-ng-charts-org-chart.d.ts +1017 -0
  102. package/types/tectra-ng-charts-org-chart.d.ts.map +1 -0
  103. package/types/tectra-ng-charts-pie.d.ts +983 -0
  104. package/types/tectra-ng-charts-pie.d.ts.map +1 -0
  105. package/types/tectra-ng-charts-radar.d.ts +903 -0
  106. package/types/tectra-ng-charts-radar.d.ts.map +1 -0
  107. package/types/tectra-ng-charts-radial-bar.d.ts +886 -0
  108. package/types/tectra-ng-charts-radial-bar.d.ts.map +1 -0
  109. package/types/tectra-ng-charts-range-area.d.ts +897 -0
  110. package/types/tectra-ng-charts-range-area.d.ts.map +1 -0
  111. package/types/tectra-ng-charts-rank-line.d.ts +839 -0
  112. package/types/tectra-ng-charts-rank-line.d.ts.map +1 -0
  113. package/types/tectra-ng-charts-sankey.d.ts +866 -0
  114. package/types/tectra-ng-charts-sankey.d.ts.map +1 -0
  115. package/types/tectra-ng-charts-scatter.d.ts +987 -0
  116. package/types/tectra-ng-charts-scatter.d.ts.map +1 -0
  117. package/types/tectra-ng-charts-segmented-bar.d.ts +751 -0
  118. package/types/tectra-ng-charts-segmented-bar.d.ts.map +1 -0
  119. package/types/tectra-ng-charts-sunburst.d.ts +864 -0
  120. package/types/tectra-ng-charts-sunburst.d.ts.map +1 -0
  121. package/types/tectra-ng-charts-treemap.d.ts +847 -0
  122. package/types/tectra-ng-charts-treemap.d.ts.map +1 -0
  123. package/types/tectra-ng-charts-waterfall.d.ts +869 -0
  124. package/types/tectra-ng-charts-waterfall.d.ts.map +1 -0
  125. package/types/tectra-ng-charts.d.ts +2 -0
  126. package/types/tectra-ng-charts.d.ts.map +1 -0
  127. package/waterfall/README.md +60 -0
package/pie/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # Pie Chart
2
+
3
+ `<tx-pie-chart>` — a donut or pie for parts of a whole: the total in the centre, the hovered segment there on hover, percent labels on the segments, a legend below or beside with values and shares. Drawn as SVG, rendered on the server and themed by the design tokens. The `txPieLegend` pipe and `pieLegend()` give the same rows and colours for your own legend.
4
+
5
+ ```ts
6
+ import { TxPieChart, TxPieLegendPipe } from '@tectra-ng/charts/pie';
7
+ ```
8
+
9
+ ```html
10
+ <tx-pie-chart [pieData]="{ series: [12, 5], labels: ['Active', 'Paused'] }" totalLabel="Total" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | pieData | Required. `{ series, labels, colors? }` — values, one label per value and optional own colours. No values or only zeros show "No data" |
17
+ | chartWidth | Width: px (200) or a CSS size |
18
+ | chartHeight | Height: px (400) or a CSS size; the donut takes the width and the legend goes under it |
19
+ | showLegend | Shows the legend |
20
+ | legendPosition | `bottom` (default), `top`, `left` or `right` |
21
+ | legendAlign | `center` (default), `start` or `end` for a top or bottom legend |
22
+ | legendVariant | Look of the legend: `dot` (default), `line`, `pill` or `stat` (each value in large type with its share; it replaces the tooltip) |
23
+ | legendValues | Lists the value and the share of each segment in the legend |
24
+ | showDataLabels | Writes the share on each segment (one decimal); slices under 10° get none |
25
+ | totalLabel | Non-empty = the total is always in the centre with this caption |
26
+ | totalFormatter | `(value) => string` for the centre total and the hovered value |
27
+ | tooltipFormatter | `(value, { seriesIndex }) => string` for the tooltip value |
28
+ | showTooltip | Shows the tooltip on hover and keyboard focus |
29
+ | valueFormat | Format of values: `number`, `integer`, `compact`, `percent` or a function |
30
+ | donutSize | Size of the hole as a share of the radius (`'65%'`); `'0%'` draws a pie |
31
+ | segmentGap | Width in px of the card-coloured gap between segments (2) |
32
+ | segmentRadius | Rounding of the segment corners in px; default — the `chart.pie.segmentRadius` token (4px). It shrinks on narrow segments and thin rings so the shape never breaks; `0` keeps sharp corners |
33
+ | startAngle | Where the first segment starts, degrees clockwise from the top (0) |
34
+ | endAngle | Where the last one ends (360); `-90` to `90` is a half donut |
35
+ | toolbar | Shows the chart menu in the top right corner: download SVG, PNG or CSV (the file is named after `ariaLabel`); a row is kept for it when the legend is not on top |
36
+ | loading | Shows a skeleton of the same size |
37
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
38
+ | dt | Design tokens of this chart (`chart`) |
39
+ | pt | Classes and styles of the parts: `root`, `legend`, `legendItem`, `plot`, `svg`, `segment`, `dataLabel`, `center`, `tooltip`, `empty`, `skeleton` |
40
+ | ptOptions | How `pt` merges with the global pass-through |
41
+ | unstyled | Removes the tectra styles and keeps the behaviour |
42
+
43
+ ## Outputs
44
+ | Name | Description |
45
+ |---|---|
46
+ | segmentClick | A segment was clicked: `index`, `label`, `value`, `percent` |
47
+ | segmentToggle | A legend item hid or showed a segment: `index`, `label`, `hidden` |
48
+
49
+ ## Slots
50
+ | Name | Description |
51
+ |---|---|
52
+ | txPieCenter | `<ng-template txPieCenter let-center>` — own centre content; `center` has `label`, `value`, `raw`, `total`, `hovered`, `index`, `color` |
53
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
54
+ | txChartLegend | `<ng-template txChartLegend let-item>` — own legend item (`label`, `color`, `hidden`, `value`, `percent`) |
55
+
56
+ ## Keyboard
57
+ | Key | Action |
58
+ |---|---|
59
+ | Tab | Focuses the chart, then the legend items |
60
+ | ← / → or ↑ / ↓ | Previous / next segment; announced with its value and share, the tooltip follows |
61
+ | Home / End | First / last segment |
62
+ | Escape | Closes the tooltip |
63
+
64
+ ## Notes
65
+
66
+ A hovered segment moves out a little, the others fade, the centre shows its value and name, and the tooltip sits at the segment's outer edge with an arrow, on the side the segment faces. `pieLegend(data)` / `data | txPieLegend` return `{ label, value, percent, color }` in series order; `percent` is 0–100 and not rounded, `color` is the CSS variable of the palette slot (it follows the theme). Segments turn in once when the chart appears and morph to new values on change; both are off with reduced motion.
@@ -0,0 +1,64 @@
1
+ # Radar Chart
2
+
3
+ `<tx-radar-chart>` — values of several series on axes spread around a centre: compare profiles, skills or ratings at a glance. Filled polygons over polygon or circular grid rings. Drawn as SVG by the component, rendered on the server and themed by the design tokens.
4
+
5
+ ```ts
6
+ import { TxRadarChart } from '@tectra-ng/charts/radar';
7
+ ```
8
+
9
+ ```html
10
+ <tx-radar-chart [series]="[{ name: 'Model A', data: [80, 60, 70, 50, 90] }]" [categories]="['Speed', 'Power', 'Range', 'Comfort', 'Price']" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | series | `{ name, data, color? }[]` — one number (or `null`) per axis. An empty list shows "No data" |
17
+ | categories | Names of the axes, clockwise from the top |
18
+ | height | Height in px (350), or a CSS size such as `'100%'` of a parent with a definite height |
19
+ | shape | Grid rings: `polygon` (default) or `circle` |
20
+ | min | Value at the centre; 0 or the nice minimum by default |
21
+ | max | Value at the outer ring; the nice maximum of the data by default |
22
+ | rings | Number of grid rings to aim for (4) |
23
+ | fill | Fills the polygons with a soft tint of the series colour (on by default) |
24
+ | markers | Draws a point on every value (on by default) |
25
+ | showTicks | Writes the ring values along the top axis |
26
+ | showLegend | Shows the legend; a single series never has one |
27
+ | legendPosition | `top`, `bottom`, `left` or `right` |
28
+ | legendAlign | `start`, `center` or `end` for a top or bottom legend |
29
+ | legendVariant | Look of the legend: `dot` (default), `line`, `pill` or `stat` (the average of each series, or the value on the focused axis, in large type; it replaces the tooltip) |
30
+ | showTooltip | Shows the tooltip on hover and keyboard focus |
31
+ | tooltipFormatter | `(value, { seriesIndex, dataPointIndex }) => string` for tooltip values |
32
+ | valueFormat | Format of the ring values and the tooltip: `number`, `integer`, `compact`, `percent` or a function |
33
+ | toolbar | Shows the chart menu in the top right corner: download SVG, PNG or CSV (the file is named after `ariaLabel`) |
34
+ | loading | Shows a skeleton of the same size |
35
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
36
+ | dt | Design tokens of this chart (`chart`) — line width, fill, points, labels, grid, palette |
37
+ | pt | Classes and styles of the parts: `root`, `legend`, `legendItem`, `plot`, `svg`, `grid`, `ring`, `axisLine`, `axisLabel`, `series`, `area`, `line`, `marker`, `tooltip`, `empty`, `skeleton` |
38
+ | ptOptions | How `pt` merges with the global pass-through |
39
+ | unstyled | Removes the tectra styles and keeps the behaviour |
40
+
41
+ ## Outputs
42
+ | Name | Description |
43
+ |---|---|
44
+ | pointClick | An axis was clicked: `seriesIndex` (the series nearest to the pointer on that axis), `dataPointIndex`, `value`, `category` |
45
+ | seriesToggle | A legend item hid or showed a series: `seriesIndex`, `name`, `hidden` |
46
+
47
+ ## Slots
48
+ | Name | Description |
49
+ |---|---|
50
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
51
+ | txChartLegend | `<ng-template txChartLegend let-item>` — own legend item |
52
+
53
+ ## Keyboard
54
+ | Key | Action |
55
+ |---|---|
56
+ | Tab | Focuses the chart, then the legend items |
57
+ | ← / → | Previous / next axis; announced, the tooltip follows |
58
+ | ↑ / ↓ | Previous / next series on the axis |
59
+ | Home / End | First / last axis |
60
+ | Escape | Closes the tooltip |
61
+
62
+ ## Notes
63
+
64
+ Hovering anywhere in a slice of the chart picks the nearest axis: its spoke and label light up, every series gets a marker on it and the tooltip lists them. The radius shrinks so the axis labels always fit. Polygons grow from the centre once and morph to new values; both are off with reduced motion.
@@ -0,0 +1,62 @@
1
+ # Radial Bar
2
+
3
+ `<tx-radial-bar>` — progress of one or several items as concentric rings over a track: goals, quotas, completion. A full circle or any arc, the share in the centre. Drawn as SVG by the component, rendered on the server and themed by the design tokens.
4
+
5
+ ```ts
6
+ import { TxRadialBar } from '@tectra-ng/charts/radial-bar';
7
+ ```
8
+
9
+ ```html
10
+ <tx-radial-bar [items]="[{ label: 'Design', value: 80 }, { label: 'Build', value: 45 }]" totalLabel="Average" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | items | `{ label, value, max?, color? }[]` — one ring per item, from the outside in. An empty list shows "No data" |
17
+ | max | Value of a full ring (100); an item's own `max` wins |
18
+ | height | Height in px (300), or a CSS size such as `'100%'` of a parent with a definite height |
19
+ | startAngle | Where the rings start, in degrees clockwise from the top (0) |
20
+ | endAngle | Where a full ring ends (360); `-135` / `135` draws a horseshoe |
21
+ | hole | Size of the empty centre as a share of the radius (`'35%'`) |
22
+ | track | Draws the track behind each ring (on by default) |
23
+ | centerValue | What the centre shows for an item: `percent` of its max (default) or the `value` |
24
+ | totalLabel | With several items, shows this caption and the average share in the centre until one is hovered |
25
+ | showLegend | Shows the legend; a single item never has one |
26
+ | legendPosition | `top`, `bottom` (default), `left` or `right` |
27
+ | legendAlign | `start`, `center` (default) or `end` for a top or bottom legend |
28
+ | legendVariant | Look of the legend: `dot` (default), `line`, `pill` or `stat` (values in large type with the share; it replaces the tooltip) |
29
+ | legendValues | Adds the value and the share to each legend item |
30
+ | showTooltip | Shows the tooltip on hover and keyboard focus |
31
+ | valueFormat | Format of the values: `number`, `integer`, `compact`, `percent` or a function |
32
+ | toolbar | Shows the chart menu: download SVG, PNG or CSV (the file is named after `ariaLabel`) |
33
+ | loading | Shows a skeleton of the same size |
34
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
35
+ | dt | Design tokens of this chart (`chart`) — track colour, ring thickness, centre text, palette |
36
+ | pt | Classes and styles of the parts: `root`, `legend`, `legendItem`, `plot`, `svg`, `track`, `bar`, `center`, `tooltip`, `empty`, `skeleton` |
37
+ | ptOptions | How `pt` merges with the global pass-through |
38
+ | unstyled | Removes the tectra styles and keeps the behaviour |
39
+
40
+ ## Outputs
41
+ | Name | Description |
42
+ |---|---|
43
+ | barClick | A ring was clicked: `index`, `label`, `value`, `share` (0–1) |
44
+ | barToggle | A legend item hid or showed a ring: `index`, `label`, `hidden` |
45
+
46
+ ## Slots
47
+ | Name | Description |
48
+ |---|---|
49
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
50
+ | txChartLegend | `<ng-template txChartLegend let-item>` — own legend item |
51
+
52
+ ## Keyboard
53
+ | Key | Action |
54
+ |---|---|
55
+ | Tab | Focuses the chart, then the legend items |
56
+ | ← / → / ↑ / ↓ | Previous / next ring; announced, the centre and the tooltip follow |
57
+ | Home / End | Outer / inner ring |
58
+ | Escape | Clears the focus |
59
+
60
+ ## Notes
61
+
62
+ Rings have round ends; values above the max fill the ring. Hovering a ring (or its legend item) fades the others and puts its label and share in the centre; the tooltip follows the mouse, or stands at the end of the ring for a tap and the keyboard. Rings draw in once, one after another, and slide to new values; both are off with reduced motion.
@@ -0,0 +1,66 @@
1
+ # Range Area Chart
2
+
3
+ `<tx-range-area-chart>` — a band from a low to a high value with an optional line inside: daily temperature from min to max with the average, a forecast with its confidence range, prices with their spread. Drawn as SVG by the component, rendered on the server and themed by the design tokens.
4
+
5
+ ```ts
6
+ import { TxRangeAreaChart } from '@tectra-ng/charts/range-area';
7
+ ```
8
+
9
+ ```html
10
+ <tx-range-area-chart [series]="[{ name: 'Temperature', low: [2, 4, 3], high: [9, 11, 10], line: [6, 7, 6] }]" [categories]="['Mon', 'Tue', 'Wed']" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | series | `{ name, low, high, line?, color? }[]` — one value per category in each array; a `null` leaves a gap. An empty list shows "No data" |
17
+ | categories | Labels of the x axis, or dates with `xType="time"` |
18
+ | xType | `category` (default) or `time` (dates at their real distance) |
19
+ | height | Height in px (350), or a CSS size such as `'100%'` of a parent with a definite height |
20
+ | curve | Shape of the band and the line: `smooth` (default), `straight` or `step` |
21
+ | edges | Draws the low and high edges of the band (on by default) |
22
+ | showLegend | Shows the legend; a single series never has one |
23
+ | legendPosition | `top`, `bottom`, `left` or `right` |
24
+ | legendAlign | `start`, `center` or `end` for a top or bottom legend |
25
+ | legendVariant | Look of the legend: `line` (default), `dot` or `pill` |
26
+ | showTooltip | Shows the line value and the range of every series on hover and keyboard focus |
27
+ | valueFormat | Value axis and tooltip format: `number`, `integer`, `compact`, `percent` or a function |
28
+ | yMin | Fixed start of the value axis |
29
+ | yMax | Fixed end of the value axis |
30
+ | xAxisTitle | Title of the x axis |
31
+ | yAxisTitle | Title of the value axis |
32
+ | grid | Grid lines: `value`, `category`, `both` or `none` |
33
+ | labelMode | Labels that do not fit: `auto`, `rotate` or `skip` |
34
+ | maxLabels | Most x labels to show (10) |
35
+ | toolbar | Shows the chart menu: download SVG, PNG or CSV (the file is named after `ariaLabel`) |
36
+ | loading | Shows a skeleton of the same size |
37
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
38
+ | dt | Design tokens of this chart (`chart`) — band opacity, edge and line widths, palette |
39
+ | pt | Classes and styles of the parts: `root`, `legend`, `legendItem`, `plot`, `svg`, `grid`, `axis`, `series`, `band`, `edge`, `line`, `marker`, `crosshair`, `tooltip`, `empty`, `skeleton` |
40
+ | ptOptions | How `pt` merges with the global pass-through |
41
+ | unstyled | Removes the tectra styles and keeps the behaviour |
42
+
43
+ ## Outputs
44
+ | Name | Description |
45
+ |---|---|
46
+ | pointClick | A category was clicked: `seriesIndex` (the band under the pointer or the nearest), `dataPointIndex`, `category`, `low`, `high`, `line` |
47
+ | seriesToggle | A legend item hid or showed a series: `seriesIndex`, `name`, `hidden` |
48
+
49
+ ## Slots
50
+ | Name | Description |
51
+ |---|---|
52
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
53
+ | txChartLegend | `<ng-template txChartLegend let-item>` — own legend item |
54
+
55
+ ## Keyboard
56
+ | Key | Action |
57
+ |---|---|
58
+ | Tab | Focuses the chart, then the legend items |
59
+ | ← / → | Previous / next category; announced, the tooltip follows |
60
+ | ↑ / ↓ | Previous / next series |
61
+ | Home / End | First / last category |
62
+ | Escape | Closes the tooltip |
63
+
64
+ ## Notes
65
+
66
+ The tooltip shows the line value with the range beside it, or the range alone. A crosshair and markers on the line and both edges follow the pointer. Bands draw in from the left once and morph to new values; both are off with reduced motion.
@@ -0,0 +1,51 @@
1
+ # Rank Chart
2
+
3
+ `<tx-rank-chart>` — positions over time (search ranks, leaderboards): rank 1 on top, one straight line per series in its own colour, a gap where a check has no rank, a tooltip with the date and time, the series, the rank and an optional note. Points sit at their real times on a time axis.
4
+
5
+ ```ts
6
+ import { TxRankChart } from '@tectra-ng/charts/rank-line';
7
+ ```
8
+
9
+ ```html
10
+ <tx-rank-chart [series]="[{ name: 'example.com', points: [{ time: '2026-03-01T09:00', rank: 4 }, { time: '2026-03-02T09:00', rank: 2 }] }]" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | series | `{ name, color?, points: { time, rank \| null, note? }[] }[]` — a `null` rank leaves a gap; without `color` the series takes one of 12 line colours by its index (`rankLineColor(index)`) |
17
+ | maxRank | The deepest rank on the axis (20); ticks by 5 up to 20, by 10 deeper; deeper ranks sit on the bottom line |
18
+ | rankLabel | Caption of the rank in the tooltip and the data table (`Position: 3`) |
19
+ | height | Height: px (360) or `'100%'` of a parent with a definite height |
20
+ | showLegend | Shows a legend that hides and shows series |
21
+ | legendPosition | `top` (default), `bottom`, `left` or `right` |
22
+ | legendAlign | `start` (default), `center` or `end` |
23
+ | legendVariant | Look of the legend markers: `line` (default), `dot` or `pill` |
24
+ | showTooltip | Shows the tooltip on hover and keyboard focus |
25
+ | loading | Shows a skeleton of the same size |
26
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
27
+ | dt | Design tokens of this chart (`chart`, group `rankLine`: line width, marker sizes, the 12 colours) |
28
+ | pt | Classes and styles of the parts: `root`, `plot`, `svg`, `grid`, `axis`, `line`, `marker`, `legend`, `legendItem`, `tooltip`, `empty`, `skeleton` |
29
+ | ptOptions | How `pt` merges with the global pass-through |
30
+ | unstyled | Removes the tectra styles and keeps the behaviour |
31
+
32
+ ## Outputs
33
+ | Name | Description |
34
+ |---|---|
35
+ | pointClick | A point was clicked: `seriesIndex`, `pointIndex`, `name`, `time`, `rank`, `note` |
36
+ | seriesToggle | A legend item hid or showed a series: `index`, `name`, `hidden` |
37
+
38
+ ## Slots
39
+ | Name | Description |
40
+ |---|---|
41
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content (`data.note` holds the note) |
42
+ | txChartLegend | `<ng-template txChartLegend let-item>` — own legend item |
43
+
44
+ ## Keyboard
45
+ | Key | Action |
46
+ |---|---|
47
+ | Tab | Focuses the chart, then the legend items |
48
+ | ← / → | Previous / next check of the series; announced with the date and rank |
49
+ | ↑ / ↓ | The nearest check of the previous / next series |
50
+ | Home / End | First / last check |
51
+ | Escape | Hides the tooltip |
@@ -0,0 +1,52 @@
1
+ # Sankey Diagram
2
+
3
+ `<tx-sankey-chart>` — how an amount flows between stages: traffic sources into pages and outcomes, a budget into departments, energy from sources to uses. Nodes stand in columns by their stage, links are as wide as their value. Drawn as SVG by the component, rendered on the server and themed by the design tokens.
4
+
5
+ ```ts
6
+ import { TxSankeyChart } from '@tectra-ng/charts/sankey';
7
+ ```
8
+
9
+ ```html
10
+ <tx-sankey-chart [links]="[{ source: 'Ads', target: 'Site', value: 60 }, { source: 'Site', target: 'Sign-up', value: 25 }]" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | links | `{ source, target, value, color? }[]` — flows between node ids; self links, zero values and links that close a cycle are left out. An empty list shows "No data" |
17
+ | nodes | `{ id, label?, color? }[]` — optional names and colours; nodes found only in `links` use their id as the name |
18
+ | height | Height in px (360), or a CSS size such as `'100%'` of a parent with a definite height |
19
+ | align | `justify` (default) — nodes without outgoing flows stand in the last column; `left` — every node stands right after its sources |
20
+ | showValues | Writes the value after each node name when it fits (on by default) |
21
+ | showTooltip | Shows the tooltip of a node (in and out totals) or a link (value and share of its source) on hover and keyboard focus |
22
+ | valueFormat | Format of the values: `number`, `integer`, `compact`, `percent` or a function |
23
+ | toolbar | Shows the chart menu: download SVG, PNG or CSV (the file is named after `ariaLabel`) |
24
+ | loading | Shows a skeleton of the same size |
25
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
26
+ | dt | Design tokens of this chart (`chart`) — node width, gap and radius, link colour strength and edge, labels, palette |
27
+ | pt | Classes and styles of the parts: `root`, `plot`, `svg`, `node`, `link`, `label`, `tooltip`, `empty`, `skeleton` |
28
+ | ptOptions | How `pt` merges with the global pass-through |
29
+ | unstyled | Removes the tectra styles and keeps the behaviour |
30
+
31
+ ## Outputs
32
+ | Name | Description |
33
+ |---|---|
34
+ | nodeClick | A node was clicked: `id`, `label`, `incoming`, `outgoing` |
35
+ | linkClick | A link was clicked: `source`, `target`, `value` |
36
+
37
+ ## Slots
38
+ | Name | Description |
39
+ |---|---|
40
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
41
+
42
+ ## Keyboard
43
+ | Key | Action |
44
+ |---|---|
45
+ | Tab | Focuses the chart |
46
+ | ← / → / ↑ / ↓ | Previous / next node, column by column; its flows light up and its totals are announced |
47
+ | Home / End | First / last node |
48
+ | Escape | Clears the focus |
49
+
50
+ ## Notes
51
+
52
+ The layout is computed by the component: columns by the longest path from a source, node heights by the larger of their in and out flow, a few passes that pull each node towards the nodes it is linked to, and links stacked on their nodes in the order of their other ends so they cross as little as possible. Hovering a node lights its flows and fades the rest; hovering a link lights it and its two nodes. Links sweep in from the left once and slide to new values; both are off with reduced motion.
@@ -0,0 +1,71 @@
1
+ # Scatter Chart
2
+
3
+ `<tx-scatter-chart>` — points on two value axes to show how two measures relate, and bubbles when a third value sets the size. Per point colours and labels, a linear trend line per series, numbers or dates on the x axis. Drawn as SVG by the component, rendered on the server and themed by the design tokens.
4
+
5
+ ```ts
6
+ import { TxScatterChart } from '@tectra-ng/charts/scatter';
7
+ ```
8
+
9
+ ```html
10
+ <tx-scatter-chart [series]="[{ name: 'Orders', data: [{ x: 12, y: 340 }, { x: 18, y: 410 }, [25, 520]] }]" trendLine />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | series | `{ name, data, color? }[]`; `data` holds points `{ x, y, size?, color?, label? }` or tuples `[x, y]` / `[x, y, size]`. A point with `size` turns the chart into bubbles; a `null` y is skipped. An empty list shows "No data" |
17
+ | xType | `linear` (numbers, default) or `time` (dates, timestamps or ISO strings) |
18
+ | annotations | Marks on the plot: `{ type: 'x-line', x }`, `{ type: 'y-line', y }`, `{ type: 'x-band', from, to }`, `{ type: 'y-band', from, to }`, `{ type: 'point', x, y }`, each with an optional `label`, `tone` (`neutral`, `primary`, `success`, `info`, `warn`, `danger`) or `color`; `x` is a number or a date like the points |
19
+ | height | Height in px (350), or a CSS size such as `'100%'` of a parent with a definite height |
20
+ | trendLine | Draws a dashed least-squares line through each series |
21
+ | showLegend | Shows the legend; a single series never has one |
22
+ | legendPosition | `top`, `bottom`, `left` or `right` |
23
+ | legendAlign | `start`, `center` or `end` for a top or bottom legend |
24
+ | legendVariant | Look of the legend: `dot` (default), `line`, `pill` or `stat` (the number of points, or the y value of the focused point, in large type; it replaces the tooltip) |
25
+ | showTooltip | Shows the tooltip on hover and keyboard focus |
26
+ | xValueFormat | Format of the x axis and x values: `number`, `integer`, `compact`, `percent` or a function (not for `time`) |
27
+ | valueFormat | Format of the y axis and y values |
28
+ | sizeFormat | Format of the bubble size in the tooltip |
29
+ | yScale | `linear` or `log` |
30
+ | xMin | Fixed start of the x axis (a timestamp for `time`) |
31
+ | xMax | Fixed end of the x axis |
32
+ | yMin | Fixed start of the y axis |
33
+ | yMax | Fixed end of the y axis |
34
+ | xAxisTitle | Title of the x axis, also the name of x in the tooltip |
35
+ | yAxisTitle | Title of the y axis, also the name of y in the tooltip |
36
+ | sizeLabel | Name of the bubble size in the tooltip; "Size" by default |
37
+ | grid | Grid lines: `both` (default), `value`, `category` (vertical) or `none` |
38
+ | xAxisPosition | Side of the x axis: `bottom` or `top` |
39
+ | yAxisPosition | Side of the y axis: `left` or `right` |
40
+ | toolbar | Shows the chart menu in the top right corner: download SVG, PNG or CSV (the file is named after `ariaLabel`) |
41
+ | loading | Shows a skeleton of the same size |
42
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
43
+ | dt | Design tokens of this chart (`chart`) — point and bubble radius, fill opacity, trend line, palette |
44
+ | pt | Classes and styles of the parts: `root`, `legend`, `legendItem`, `plot`, `svg`, `grid`, `axis`, `annotation`, `point`, `trendLine`, `guide`, `tooltip`, `empty`, `skeleton` |
45
+ | ptOptions | How `pt` merges with the global pass-through |
46
+ | unstyled | Removes the tectra styles and keeps the behaviour |
47
+
48
+ ## Outputs
49
+ | Name | Description |
50
+ |---|---|
51
+ | pointClick | A point was clicked: `seriesIndex`, `dataPointIndex` (in the series `data`), `x`, `y`, `size`, `label` |
52
+ | seriesToggle | A legend item hid or showed a series: `seriesIndex`, `name`, `hidden` |
53
+
54
+ ## Slots
55
+ | Name | Description |
56
+ |---|---|
57
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content; `data.rows` holds the series, x, y and size |
58
+ | txChartLegend | `<ng-template txChartLegend let-item>` — own legend item |
59
+
60
+ ## Keyboard
61
+ | Key | Action |
62
+ |---|---|
63
+ | Tab | Focuses the chart, then the legend items |
64
+ | ← / → | Previous / next point of the series by x; announced, the tooltip follows |
65
+ | ↑ / ↓ | Previous / next series, at the point nearest to the same x |
66
+ | Home / End | First / last point of the series |
67
+ | Escape | Closes the tooltip |
68
+
69
+ ## Notes
70
+
71
+ The pointer picks the nearest point within a few pixels of its edge, so small points are easy to hit; the point gets a ring in its colour and dashed guides to both axes. A bubble's area, not its radius, follows its size, and bigger bubbles are drawn first so small ones stay on top. Points pop in once when the chart appears and slide to new values on change; both are off with reduced motion.
@@ -0,0 +1,35 @@
1
+ # Segmented Bar
2
+
3
+ `<tx-segmented-bar>` — parts of one whole in one bar with a legend: each part is a segment as wide as its share, coloured by a tone. A small 7px bar or a large one with the percent inside each segment; the legend lists the parts with their values and shares, and projected content sits at its end.
4
+
5
+ ```ts
6
+ import { TxSegmentedBar } from '@tectra-ng/charts/segmented-bar';
7
+ ```
8
+
9
+ ```html
10
+ <tx-segmented-bar [items]="[{ key: 'paid', label: 'Paid', value: 8, tone: 'success' }, { key: 'due', label: 'Due', value: 3, tone: 'warn' }]" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | items | `{ key, label, value, tone? }[]` — parts in the order they are drawn; zero and negative values are not drawn |
17
+ | size | `small` (thin rounded bar, default) or `large` (tall bar with the percent inside each segment) |
18
+ | showLegend | Shows the legend under the bar |
19
+ | showValue | Shows the value of each part in the legend |
20
+ | showPercent | Shows the share of each part in the legend |
21
+ | hideEmptyInLegend | Leaves parts with no value out of the legend |
22
+ | monoLabels | Writes the legend labels in the monospace font (codes, ids) |
23
+ | valueFormat | Format of values: `number`, `integer`, `compact`, `percent` or a function |
24
+ | ariaLabel | What the bar shows; names the legend list, or starts the summary read on the bar when the legend is hidden |
25
+ | dt | Design tokens of this bar (`chart`, group `segmentedBar`) |
26
+ | pt | Classes and styles of the parts: `root`, `track`, `segment`, `legend`, `legendItem`, `dot`, `label`, `value`, `percent`, `aside` |
27
+ | ptOptions | How `pt` merges with the global pass-through |
28
+ | unstyled | Removes the tectra styles and keeps the behaviour |
29
+
30
+ Tones: `primary` (default), `secondary` (the primary colour mixed into the card), `success`, `info`, `warn`, `danger`, `neutral`.
31
+
32
+ ## Slots
33
+ | Name | Description |
34
+ |---|---|
35
+ | default | Content at the end of the legend row (a total, a link) |
@@ -0,0 +1,55 @@
1
+ # Sunburst Chart
2
+
3
+ `<tx-sunburst-chart>` — a hierarchy as nested rings: each ring is a level, each segment is its share of the parent. Click a segment to zoom into it, click the centre to go back. Drawn as SVG by the component, rendered on the server and themed by the design tokens.
4
+
5
+ ```ts
6
+ import { TxSunburstChart } from '@tectra-ng/charts/sunburst';
7
+ ```
8
+
9
+ ```html
10
+ <tx-sunburst-chart [data]="[{ label: 'Europe', children: [{ label: 'France', value: 30 }, { label: 'Spain', value: 10 }] }]" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | data | `{ label, value?, children?, color? }` or a list of them. A node's size is its `value`, or the sum of its children; children of a node with a larger `value` leave the rest of its arc empty. `color` applies to the node and its branch. Nothing with a value shows "No data" |
17
+ | levels | Rings shown at once (3); deeper levels appear when you zoom in |
18
+ | height | Height in px (380), or a CSS size such as `'100%'` of a parent with a definite height |
19
+ | drill | Clicking a segment with children zooms into it and the centre leads back (on by default) |
20
+ | showLabels | Writes the names on segments where they fit (on by default) |
21
+ | showTooltip | Shows the value, the share of the parent and of the total on hover and keyboard focus |
22
+ | totalLabel | Caption of the centre at the top level; "Total" by default |
23
+ | valueFormat | Format of the values: `number`, `integer`, `compact`, `percent` or a function |
24
+ | toolbar | Shows the chart menu: download SVG, PNG or CSV (the file is named after `ariaLabel`) |
25
+ | loading | Shows a skeleton of the same size |
26
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
27
+ | dt | Design tokens of this chart (`chart`) — hole, gaps, corner radius, the fade of deeper rings, labels, centre, palette |
28
+ | pt | Classes and styles of the parts: `root`, `plot`, `svg`, `segment`, `label`, `center`, `tooltip`, `empty`, `skeleton` |
29
+ | ptOptions | How `pt` merges with the global pass-through |
30
+ | unstyled | Removes the tectra styles and keeps the behaviour |
31
+
32
+ ## Outputs
33
+ | Name | Description |
34
+ |---|---|
35
+ | segmentClick | A segment was clicked or chosen with Enter: `path` (names from the top), `value`, `item` |
36
+ | focusChange | The chart zoomed in or out: the names of the branch now in the centre (`[]` at the top) |
37
+
38
+ ## Slots
39
+ | Name | Description |
40
+ |---|---|
41
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
42
+
43
+ ## Keyboard
44
+ | Key | Action |
45
+ |---|---|
46
+ | Tab | Focuses the chart |
47
+ | ← / → | Previous / next segment of the same parent |
48
+ | ↓ / ↑ | First child / the parent |
49
+ | Home / End | First / last segment of the inner ring |
50
+ | Enter / Space | Zooms into the segment (and reports `segmentClick`) |
51
+ | Escape / Backspace | Clears the focus, then zooms out a level |
52
+
53
+ ## Notes
54
+
55
+ Each branch takes the palette colour of its top segment and deeper rings fade towards the card colour, so the hierarchy reads at a glance. Hovering a segment keeps it and its parents bright and fades the rest. Zooming in or out redraws the rings with a short turn-in; off with reduced motion.
@@ -0,0 +1,47 @@
1
+ # Treemap
2
+
3
+ `<tx-treemap>` — shares of a total as nested rectangles: each item is a tile with an area proportional to its value (squarified layout), the name and the formatted value drawn inside, cut with an ellipsis when the tile is narrow; `txTreemapTile` draws your own tile content. Items with `children` become a labelled group with their own tiles. Zero values are dropped; no positive value shows "No data".
4
+
5
+ ```ts
6
+ import { TxTreemap } from '@tectra-ng/charts/treemap';
7
+ ```
8
+
9
+ ```html
10
+ <tx-treemap [items]="[{ label: 'Hosting', value: 1840 }, { label: 'Ads', value: 920 }]" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | items | `{ label, value?, color?, children? }[]` — tiles, or groups with `children` (a group's value is the sum of its children) |
17
+ | height | Height: px (350) or `'100%'` of a parent with a definite height |
18
+ | showDataLabels | Writes the name inside each tile that has room for it (long names end with an ellipsis) |
19
+ | showValues | Writes the formatted value under the name when it fits |
20
+ | showTooltip | Shows the tooltip on hover and keyboard focus |
21
+ | tooltipFormatter | `(value, { seriesIndex, dataPointIndex }) => string` for the tooltip value |
22
+ | valueFormat | Format of values: `number`, `integer`, `compact`, `percent` or a function |
23
+ | loading | Shows a skeleton of the same size |
24
+ | ariaLabel | What the treemap shows; starts the summary read by screen readers |
25
+ | dt | Design tokens of this treemap (`chart`, group `treemap`) |
26
+ | pt | Classes and styles of the parts: `root`, `plot`, `svg`, `tile`, `tileContent`, `tileLabel`, `tileValue`, `group`, `groupLabel`, `tooltip`, `empty`, `skeleton` |
27
+ | ptOptions | How `pt` merges with the global pass-through |
28
+ | unstyled | Removes the tectra styles and keeps the behaviour |
29
+
30
+ ## Outputs
31
+ | Name | Description |
32
+ |---|---|
33
+ | tileClick | A tile was clicked: `index`, `path` (indexes from the top level), `label`, `group`, `value`, `share` |
34
+
35
+ ## Slots
36
+ | Name | Description |
37
+ |---|---|
38
+ | txTreemapTile | `<ng-template txTreemapTile let-tile>` — own content of every tile; context `label`, `value` (formatted), `share`, `color`, `width`, `height`, clipped to the tile |
39
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
40
+
41
+ ## Keyboard
42
+ | Key | Action |
43
+ |---|---|
44
+ | Tab | Focuses the treemap |
45
+ | ← / → or ↑ / ↓ | Previous / next tile; announced with its value and share, the tooltip follows |
46
+ | Home / End | First / last tile |
47
+ | Escape | Hides the tooltip |