@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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tectra contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,46 @@
1
1
  # @tectra-ng/charts
2
2
 
3
- Placeholder of the tectra charts package. Install a newer version — docs at [tectra-ng.com](https://tectra-ng.com).
3
+ Angular charts drawn as SVG by the components themselves — no chart library and no dependencies. They render on the server with the same markup the browser hydrates, take every colour, font and size from the tectra design tokens (themes, dark mode and `dt` just work), use the kit's legend, tooltip overlay and locale, and can be read with the keyboard and screen readers.
4
+
5
+ ```bash
6
+ npm install @tectra-ng/charts
7
+ ```
8
+
9
+ Part of `tectra-ng`. One entry point per chart, so you only bundle what you import:
10
+
11
+ | Entry point | What it holds |
12
+ |---|---|
13
+ | `@tectra-ng/charts/line` | `<tx-line-chart>` — line and area, stacked and 100%, time axis, gaps, decimation |
14
+ | `@tectra-ng/charts/column` | `<tx-column-chart>` — columns and bars, stacked, 100% and grouped, data labels, negative values |
15
+ | `@tectra-ng/charts/combo` | `<tx-combo-chart>` — columns with lines or areas in one plot, a second value axis aligned to the grid of the first |
16
+ | `@tectra-ng/charts/scatter` | `<tx-scatter-chart>` — points and bubbles on two value axes, per point colours and labels, trend lines, a time x axis |
17
+ | `@tectra-ng/charts/pie` | `<tx-pie-chart>` — pie, donut and half donut, centre total, legend with values, `txPieLegend` |
18
+ | `@tectra-ng/charts/radar` | `<tx-radar-chart>` — series on axes around a centre, polygon or circular rings, filled areas |
19
+ | `@tectra-ng/charts/radial-bar` | `<tx-radial-bar>` — progress rings over a track, a full circle or any arc, the share in the centre |
20
+ | `@tectra-ng/charts/gauge` | `<tx-gauge>` — one value on a scale: a progress arc in a tone, or a needle over coloured bands |
21
+ | `@tectra-ng/charts/funnel` | `<tx-funnel-chart>` — steps of a process as centred bars with connectors and the conversion between them |
22
+ | `@tectra-ng/charts/waterfall` | `<tx-waterfall-chart>` — a running total built step by step, increases and decreases in their own colours, total bars |
23
+ | `@tectra-ng/charts/bullet` | `<tx-bullet-chart>` — a value against a target over qualitative ranges, one row per measure on a shared scale |
24
+ | `@tectra-ng/charts/candlestick` | `<tx-candlestick-chart>` — candles or OHLC bars with the volume under them, no gaps for days off |
25
+ | `@tectra-ng/charts/boxplot` | `<tx-boxplot-chart>` — quartiles, median, whiskers and outliers from raw values or ready numbers, series side by side |
26
+ | `@tectra-ng/charts/range-area` | `<tx-range-area-chart>` — a low–high band with a line inside, category or time axis |
27
+ | `@tectra-ng/charts/gantt` | `<tx-gantt-chart>` — tasks on a calendar with groups, progress, milestones and a today line, zoom from days to quarters, a timeline layout of lanes |
28
+ | `@tectra-ng/charts/sankey` | `<tx-sankey-chart>` — flows between stages as links as wide as their value, nodes in columns, own layout |
29
+ | `@tectra-ng/charts/sunburst` | `<tx-sunburst-chart>` — a hierarchy as nested rings, zoom into a branch and back from the centre |
30
+ | `@tectra-ng/charts/bar-list` | `<tx-bar-list>` — a top-N ranking: label over a share bar, value and percent of the total, router links |
31
+ | `@tectra-ng/charts/segmented-bar` | `<tx-segmented-bar>` — parts of one whole in one bar with tones, a small or a large bar, legend with values and shares |
32
+ | `@tectra-ng/charts/heatmap` | `<tx-heatmap>` — rows × grouped columns coloured by tones or a value scale, sticky headers, cell tooltips and clicks, `heatmapCalendar()` |
33
+ | `@tectra-ng/charts/treemap` | `<tx-treemap>` — squarified tiles sized by value, labels that fit, nested groups |
34
+ | `@tectra-ng/charts/rank-line` | `<tx-rank-chart>` — positions over time, rank 1 on top, gaps, notes in the tooltip |
35
+ | `@tectra-ng/charts/org-chart` | `<tx-org-chart>` — a tree of cards on a pan / zoom canvas with search, minimap, full screen and hotkeys |
36
+ | `@tectra-ng/charts/core` | scales, ticks, formats, curves, stacks, the chart frame, axes and legend — for your own charts |
37
+
38
+ ```ts
39
+ import { TxLineChart } from '@tectra-ng/charts/line';
40
+ ```
41
+
42
+ ```html
43
+ <tx-line-chart [series]="[{ name: 'Visits', data: [120, 180, 150] }]" [categories]="['Mon', 'Tue', 'Wed']" />
44
+ ```
45
+
46
+ Peer dependencies: `@angular/core`, `@angular/common`, `@angular/cdk`, `@angular/router` (optional, for bar list links), `@tectra-ng/core`, `@tectra-ng/themes`, `@tectra-ng/ui`, `@tectra-ng/icons`. Docs and examples: [tectra-ng.com](https://tectra-ng.com/components/line-chart).
@@ -0,0 +1,30 @@
1
+ # Bar List
2
+
3
+ `<tx-bar-list>` — a top-N ranking: each row is a label over a bar scaled to the biggest value, the formatted value and its percent of the total. Rows are sorted from the biggest value, zero and negative values are dropped, a row with a link becomes a router link.
4
+
5
+ ```ts
6
+ import { TxBarList } from '@tectra-ng/charts/bar-list';
7
+ ```
8
+
9
+ ```html
10
+ <tx-bar-list [items]="[{ label: 'Germany', value: 420 }, { label: 'France', value: 310 }]" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | items | `{ label, value, link?, queryParams? }[]` — rows in any order; no positive values show "No data" |
17
+ | limit | How many rows to show (10); the percent stays the share of the whole total |
18
+ | valueFormat | Format of values: `number`, `integer`, `compact`, `percent` or a function |
19
+ | loading | Shows skeleton rows |
20
+ | ariaLabel | What the list shows, read by screen readers |
21
+ | dt | Design tokens of this list (`chart`, group `barList`) |
22
+ | pt | Classes and styles of the parts: `root`, `list`, `item`, `row`, `track`, `bar`, `label`, `value`, `percent`, `empty`, `skeleton` |
23
+ | ptOptions | How `pt` merges with the global pass-through |
24
+ | unstyled | Removes the tectra styles and keeps the behaviour |
25
+
26
+ ## Keyboard
27
+ | Key | Action |
28
+ |---|---|
29
+ | Tab | Moves between rows that have a link |
30
+ | Enter | Opens the link of the focused row |
@@ -0,0 +1,62 @@
1
+ # Box Plot
2
+
3
+ `<tx-boxplot-chart>` — how values spread in each category: the box from the first to the third quartile, the median, whiskers to the last values within 1.5 × IQR and the outliers beyond. Several series stand side by side. Drawn as SVG by the component, rendered on the server and themed by the design tokens.
4
+
5
+ ```ts
6
+ import { TxBoxplotChart } from '@tectra-ng/charts/boxplot';
7
+ ```
8
+
9
+ ```html
10
+ <tx-boxplot-chart [series]="[{ name: 'Response time', data: [[120, 135, 150, 180, 420], [90, 110, 115, 140]] }]" [categories]="['API', 'Web']" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | series | `{ name, data, color? }[]`; each entry of `data` is either raw values (`number[]`, the five numbers are computed) or ready numbers `{ min, q1, median, q3, max, outliers? }`, or `null`. An empty list shows "No data" |
17
+ | categories | Labels of the category axis, one per entry |
18
+ | height | Height in px (350), or a CSS size such as `'100%'` of a parent with a definite height |
19
+ | showOutliers | Draws the outliers as rings (on by default) |
20
+ | showLegend | Shows the legend; a single series never has one |
21
+ | legendPosition | `top`, `bottom`, `left` or `right` |
22
+ | legendAlign | `start`, `center` or `end` for a top or bottom legend |
23
+ | showTooltip | Shows the five numbers and the count of outliers on hover and keyboard focus |
24
+ | valueFormat | Value axis and tooltip format: `number`, `integer`, `compact`, `percent` or a function |
25
+ | yMin | Fixed start of the value axis |
26
+ | yMax | Fixed end of the value axis |
27
+ | xAxisTitle | Title of the category axis |
28
+ | yAxisTitle | Title of the value axis |
29
+ | grid | Grid lines: `value`, `category`, `both` or `none` |
30
+ | labelMode | Category labels that do not fit: `auto`, `rotate` or `skip` |
31
+ | toolbar | Shows the chart menu: download SVG, PNG or CSV (the file is named after `ariaLabel`) |
32
+ | loading | Shows a skeleton of the same size |
33
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
34
+ | dt | Design tokens of this chart (`chart`) — box width and radius, fill, line widths, whisker caps, outliers, palette |
35
+ | pt | Classes and styles of the parts: `root`, `hoverBand`, `legend`, `legendItem`, `plot`, `svg`, `grid`, `axis`, `box`, `median`, `whisker`, `outlier`, `tooltip`, `empty`, `skeleton` |
36
+ | ptOptions | How `pt` merges with the global pass-through |
37
+ | unstyled | Removes the tectra styles and keeps the behaviour |
38
+
39
+ ## Outputs
40
+ | Name | Description |
41
+ |---|---|
42
+ | boxClick | A box was clicked: `seriesIndex`, `dataPointIndex`, `category`, `stats` (the five numbers and the outliers) |
43
+ | seriesToggle | A legend item hid or showed a series: `seriesIndex`, `name`, `hidden` |
44
+
45
+ ## Slots
46
+ | Name | Description |
47
+ |---|---|
48
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
49
+ | txChartLegend | `<ng-template txChartLegend let-item>` — own legend item |
50
+
51
+ ## Keyboard
52
+ | Key | Action |
53
+ |---|---|
54
+ | Tab | Focuses the chart, then the legend items |
55
+ | ← / → | Previous / next category; the five numbers are announced, the tooltip follows |
56
+ | ↑ / ↓ | Previous / next series in the category |
57
+ | Home / End | First / last category |
58
+ | Escape | Closes the tooltip |
59
+
60
+ ## Notes
61
+
62
+ Quartiles are interpolated between values (the method of most spreadsheets). Hovering a category lays a soft band under it, picks the nearest box and fades the others. Boxes grow once; off with reduced motion.
@@ -0,0 +1,53 @@
1
+ # Bullet Chart
2
+
3
+ `<tx-bullet-chart>` — a value against a target over qualitative ranges (poor / fair / good), one compact row per measure on a shared scale. A dashboard-friendly replacement for a row of gauges. Drawn as SVG by the component, rendered on the server and themed by the design tokens.
4
+
5
+ ```ts
6
+ import { TxBulletChart } from '@tectra-ng/charts/bullet';
7
+ ```
8
+
9
+ ```html
10
+ <tx-bullet-chart [items]="[{ label: 'Revenue', value: 72, target: 85 }]" [ranges]="[50, 80]" [max]="100" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | items | `{ label, value, target?, ranges?, color? }[]` — one row per measure; an item's `ranges` override the shared ones. An empty list shows "No data" |
17
+ | ranges | Thresholds of the qualitative ranges, from low to high: `[50, 80]` gives 0–50, 50–80, 80–max; the first range is the darkest |
18
+ | min | Start of the scale (0) |
19
+ | max | End of the scale; the biggest value, target or threshold by default |
20
+ | height | Height in px; by default one `chart.bullet.rowHeight` per row plus the axis |
21
+ | showTooltip | Shows the value and the target on hover and keyboard focus |
22
+ | valueFormat | Format of the axis and the tooltip: `number`, `integer`, `compact`, `percent` or a function |
23
+ | grid | Grid lines: `value` (default), `category`, `both` or `none` |
24
+ | maxLabelWidth | Longer row labels are cut with an ellipsis (180px) |
25
+ | toolbar | Shows the chart menu: download SVG, PNG or CSV |
26
+ | loading | Shows a skeleton of the same size |
27
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
28
+ | dt | Design tokens of this chart (`chart`) — row height, range shades, bar and target size and colour |
29
+ | pt | Classes and styles of the parts: `root`, `hoverBand`, `plot`, `svg`, `grid`, `axis`, `range`, `bar`, `target`, `tooltip`, `empty`, `skeleton` |
30
+ | ptOptions | How `pt` merges with the global pass-through |
31
+ | unstyled | Removes the tectra styles and keeps the behaviour |
32
+
33
+ ## Outputs
34
+ | Name | Description |
35
+ |---|---|
36
+ | barClick | A row was clicked: `index`, `label`, `value`, `target` |
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 row; the value and the target are announced, the tooltip follows |
48
+ | Home / End | First / last row |
49
+ | Escape | Closes the tooltip |
50
+
51
+ ## Notes
52
+
53
+ Rows share one scale so they compare at a glance; use separate charts for measures in different units. Hovering a row lays a soft band under it and fades the others. Value bars grow once and slide to new values; both are off with reduced motion.
@@ -0,0 +1,57 @@
1
+ # Candlestick Chart
2
+
3
+ `<tx-candlestick-chart>` — prices over time as candles or OHLC bars: open, high, low and close of each period, rising and falling in their own colours, with the volume under them. Drawn as SVG by the component, rendered on the server and themed by the design tokens.
4
+
5
+ ```ts
6
+ import { TxCandlestickChart } from '@tectra-ng/charts/candlestick';
7
+ ```
8
+
9
+ ```html
10
+ <tx-candlestick-chart [data]="[{ x: '2026-03-02', open: 100, high: 112, low: 97, close: 110, volume: 1200 }]" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | data | `{ x, open, high, low, close, volume? }[]` in time order; `x` is a date (`Date` or an ISO string) or any label. Periods stand side by side, so weekends and holidays leave no gaps. An empty list shows "No data" |
17
+ | variant | `candle` (default) or `ohlc` (a bar with ticks for the open and the close) |
18
+ | showVolume | Draws the volume as bars along the bottom, on their own scale (on when there is volume) |
19
+ | height | Height in px (380), or a CSS size such as `'100%'` of a parent with a definite height |
20
+ | showTooltip | Shows open, high, low, close and volume on hover and keyboard focus |
21
+ | valueFormat | Price format: `number`, `integer`, `compact`, `percent` or a function |
22
+ | volumeFormat | Volume format in the tooltip (`compact`) |
23
+ | yMin | Fixed start of the price axis |
24
+ | yMax | Fixed end of the price axis |
25
+ | yAxisTitle | Title of the price axis |
26
+ | grid | Grid lines: `value` (default), `category`, `both` or `none` |
27
+ | labelMode | Date labels that do not fit: `skip` (default), `auto` or `rotate` |
28
+ | yAxisPosition | Side of the price axis: `right` (default) or `left` |
29
+ | toolbar | Shows the chart menu: download SVG, PNG or CSV (the file is named after `ariaLabel`) |
30
+ | loading | Shows a skeleton of the same size |
31
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
32
+ | dt | Design tokens of this chart (`chart`) — up and down colours, body width and radius, wick width, volume height and opacity |
33
+ | pt | Classes and styles of the parts: `root`, `plot`, `svg`, `grid`, `axis`, `candle`, `wick`, `body`, `volume`, `crosshair`, `tooltip`, `empty`, `skeleton` |
34
+ | ptOptions | How `pt` merges with the global pass-through |
35
+ | unstyled | Removes the tectra styles and keeps the behaviour |
36
+
37
+ ## Outputs
38
+ | Name | Description |
39
+ |---|---|
40
+ | candleClick | A period was clicked: `index`, `label` (the formatted date), `candle` |
41
+
42
+ ## Slots
43
+ | Name | Description |
44
+ |---|---|
45
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
46
+
47
+ ## Keyboard
48
+ | Key | Action |
49
+ |---|---|
50
+ | Tab | Focuses the chart |
51
+ | ← / → | Previous / next period; the four prices are announced, the tooltip follows |
52
+ | Home / End | First / last period |
53
+ | Escape | Closes the tooltip |
54
+
55
+ ## Notes
56
+
57
+ A rising period (close ≥ open) takes the up colour, a falling one the down colour; the volume bar under it takes the same colour, softer. The price axis leaves the bottom part of the chart to the volume, so candles and volume do not overlap. Hovering a period draws a crosshair and fades the others. Candles grow once; off with reduced motion.
@@ -0,0 +1,73 @@
1
+ # Column Chart
2
+
3
+ `<tx-column-chart>` — columns or horizontal bars for comparing values across categories: stacked, 100% stacked or grouped. Drawn as SVG by the component, rendered on the server and themed by the design tokens.
4
+
5
+ ```ts
6
+ import { TxColumnChart } from '@tectra-ng/charts/column';
7
+ ```
8
+
9
+ ```html
10
+ <tx-column-chart [series]="series" [categories]="weekdays" stackType="100%" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | series | `{ name, data, color? }[]` — one number (or `null`) per category. An empty list shows "No data" |
17
+ | categories | Labels of the category axis, one per value |
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 category label or index; an `x-band` covers whole categories. In a horizontal chart the lines turn with the axes |
19
+ | stacked | Stacks the series (default); `false` groups them side by side |
20
+ | stackType | `normal` or `100%` (every category to 100%; also turns stacking on) |
21
+ | height | Height in px (350), or a CSS size such as `'100%'` of a parent with a definite height |
22
+ | horizontal | Draws horizontal bars with the categories on the left |
23
+ | dataLabels | Writes each value on its bar (inside when it fits) |
24
+ | showLegend | Shows the legend; a single series never has one |
25
+ | legendPosition | `top`, `bottom`, `left` or `right` |
26
+ | legendAlign | `start`, `center` or `end` for a top or bottom legend |
27
+ | legendVariant | Look of the legend: `dot` (default), `line`, `pill` or `stat` (series totals, or the hovered column's values, in large type; it replaces the tooltip) |
28
+ | showTooltip | Shows the tooltip on hover and keyboard focus |
29
+ | tooltipMode | `shared` (every series of the category) or `single` |
30
+ | tooltipFormatter | `(value, { seriesIndex, dataPointIndex }) => string` for tooltip and data label values; default — the locale number format |
31
+ | valueFormat | Value axis format: `number`, `integer`, `compact`, `percent` or a function |
32
+ | yScale | `linear` or `log` |
33
+ | yMin | Fixed start of the value axis |
34
+ | yMax | Fixed end of the value axis |
35
+ | xAxisTitle | Title of the category axis |
36
+ | yAxisTitle | Title of the value axis |
37
+ | grid | Grid lines: `value`, `category`, `both` or `none` |
38
+ | xAxisPosition | Side of the horizontal axis: `bottom` or `top` |
39
+ | yAxisPosition | Side of the vertical axis: `left` or `right` |
40
+ | labelMode | Category labels that do not fit: `auto`, `rotate` or `skip` |
41
+ | maxLabelWidth | Longer category labels are cut with an ellipsis (220px) |
42
+ | 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 |
43
+ | loading | Shows a skeleton of the same size |
44
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
45
+ | dt | Design tokens of this chart (`chart`) — bar radius, width and gap, palette, labels |
46
+ | pt | Classes and styles of the parts: `root`, `hoverBand`, `annotation`, `legend`, `legendItem`, `plot`, `svg`, `grid`, `axis`, `bar`, `dataLabel`, `tooltip`, `empty`, `skeleton` |
47
+ | ptOptions | How `pt` merges with the global pass-through |
48
+ | unstyled | Removes the tectra styles and keeps the behaviour |
49
+
50
+ ## Outputs
51
+ | Name | Description |
52
+ |---|---|
53
+ | barClick | A bar was clicked: `seriesIndex`, `dataPointIndex`, `value`, `category` |
54
+ | seriesToggle | A legend item hid or showed a series: `seriesIndex`, `name`, `hidden` |
55
+
56
+ ## Slots
57
+ | Name | Description |
58
+ |---|---|
59
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
60
+ | txChartLegend | `<ng-template txChartLegend let-item>` — own legend item |
61
+
62
+ ## Keyboard
63
+ | Key | Action |
64
+ |---|---|
65
+ | Tab | Focuses the chart, then the legend items |
66
+ | ← / → | Previous / next category (↑ / ↓ when `horizontal`); announced, the tooltip follows |
67
+ | ↑ / ↓ | Previous / next series in the category (← / → when `horizontal`) |
68
+ | Home / End | First / last category |
69
+ | Escape | Closes the tooltip |
70
+
71
+ ## Notes
72
+
73
+ Hovering anywhere in a category lays a soft band under it, highlights its columns, fades the others and shows the tooltip beside the cursor (a tap or the keyboard pins it above the column with an arrow); a stack also shows its total. Only the outer end of a stack is rounded and the segments are split by a thin card-coloured gap. Bars grow from the zero line once when the chart appears and slide to new values on change; both are off with reduced motion. The bar width, the gap between grouped bars and the radius come from the `chart.bar` tokens.
@@ -0,0 +1,83 @@
1
+ # Combo Chart
2
+
3
+ `<tx-combo-chart>` — columns and lines (or areas) in one plot, each series on the main or a second value axis: revenue in columns with a margin line in percent, visits with a conversion rate. Drawn as SVG by the component, rendered on the server and themed by the design tokens.
4
+
5
+ ```ts
6
+ import { TxComboChart } from '@tectra-ng/charts/combo';
7
+ ```
8
+
9
+ ```html
10
+ <tx-combo-chart
11
+ [series]="[
12
+ { name: 'Revenue', data: [40, 52, 61] },
13
+ { name: 'Margin', data: [18, 22, 25], type: 'line', axis: 'secondary' },
14
+ ]"
15
+ [categories]="['Jan', 'Feb', 'Mar']"
16
+ y2ValueFormat="percent"
17
+ />
18
+ ```
19
+
20
+ ## Inputs
21
+ | Name | Description |
22
+ |---|---|
23
+ | series | `{ name, data, color?, type?, axis? }[]` — one number (or `null`) per category; `type` is `column` (default), `line` or `area`, `axis` is `primary` (default) or `secondary`. An empty list shows "No data" |
24
+ | categories | Labels of the category axis, one per value |
25
+ | 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 category label or index; `axis: 'secondary'` puts a `y-line`, `y-band` or `point` on the second value axis |
26
+ | height | Height in px (350), or a CSS size such as `'100%'` of a parent with a definite height |
27
+ | stacked | Stacks the column series of each axis; by default they stand side by side |
28
+ | curve | Shape of the lines: `smooth` (default), `straight` or `step` |
29
+ | markers | Draws a point on every line value (on by default; dropped when the points are too dense) |
30
+ | showLegend | Shows the legend; a single series never has one. Line series get a line marker, columns a dot |
31
+ | legendPosition | `top`, `bottom`, `left` or `right` |
32
+ | legendAlign | `start`, `center` or `end` for a top or bottom legend |
33
+ | legendVariant | Look of the legend: `dot` (default), `line`, `pill` or `stat` (column totals and the last line value, or the hovered category, in large type; it replaces the tooltip) |
34
+ | showTooltip | Shows the tooltip on hover and keyboard focus |
35
+ | tooltipMode | `shared` (every series of the category) or `single` |
36
+ | tooltipFormatter | `(value, { seriesIndex, dataPointIndex }) => string` for tooltip values; default — the format of the series' axis |
37
+ | valueFormat | Format of the main value axis: `number`, `integer`, `compact`, `percent` or a function |
38
+ | y2ValueFormat | Format of the second value axis; the main one by default |
39
+ | yScale | `linear` or `log` for the main value axis |
40
+ | yMin | Fixed start of the main value axis |
41
+ | yMax | Fixed end of the main value axis |
42
+ | y2Min | Fixed start of the second value axis |
43
+ | y2Max | Fixed end of the second value axis |
44
+ | xAxisTitle | Title of the category axis |
45
+ | yAxisTitle | Title of the main value axis |
46
+ | y2AxisTitle | Title of the second value axis |
47
+ | grid | Grid lines: `value`, `category`, `both` or `none` |
48
+ | xAxisPosition | Side of the category axis: `bottom` or `top` |
49
+ | yAxisPosition | Side of the main value axis: `left` or `right`; the second axis takes the other side |
50
+ | labelMode | Category labels that do not fit: `auto`, `rotate` or `skip` |
51
+ | maxLabelWidth | Longer category labels are cut with an ellipsis (220px) |
52
+ | toolbar | Shows the chart menu in the top right corner: download SVG, PNG or CSV (the file is named after `ariaLabel`) |
53
+ | loading | Shows a skeleton of the same size |
54
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
55
+ | dt | Design tokens of this chart (`chart`) — bar radius, width and gap, line width, markers, palette |
56
+ | pt | Classes and styles of the parts: `root`, `hoverBand`, `annotation`, `legend`, `legendItem`, `plot`, `svg`, `grid`, `axis`, `bar`, `series`, `line`, `area`, `marker`, `tooltip`, `empty`, `skeleton` |
57
+ | ptOptions | How `pt` merges with the global pass-through |
58
+ | unstyled | Removes the tectra styles and keeps the behaviour |
59
+
60
+ ## Outputs
61
+ | Name | Description |
62
+ |---|---|
63
+ | pointClick | A category was clicked: `seriesIndex` (the bar under the pointer or the nearest line), `dataPointIndex`, `value`, `category` |
64
+ | seriesToggle | A legend item hid or showed a series: `seriesIndex`, `name`, `hidden` |
65
+
66
+ ## Slots
67
+ | Name | Description |
68
+ |---|---|
69
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
70
+ | txChartLegend | `<ng-template txChartLegend let-item>` — own legend item |
71
+
72
+ ## Keyboard
73
+ | Key | Action |
74
+ |---|---|
75
+ | Tab | Focuses the chart, then the legend items |
76
+ | ← / → | Previous / next category; announced, the tooltip follows |
77
+ | ↑ / ↓ | Previous / next series in the category |
78
+ | Home / End | First / last category |
79
+ | Escape | Closes the tooltip |
80
+
81
+ ## Notes
82
+
83
+ The ticks of the second axis stand on the grid lines of the main one, and zero sits on one line for both, so there is one grid and no double lines; with `y2Min` / `y2Max` the second axis keeps its own ticks. Hovering anywhere in a category lays a soft band under it, highlights its columns, fades the others and marks the line values; the tooltip follows the mouse (with the keyboard or a tap it stands above the highest of them). Columns grow once when the chart appears and lines draw in from the left; both slide to new values on change and are off with reduced motion.
package/core/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # Charts core
2
+
3
+ `@tectra-ng/charts/core` — the shared core of every tectra chart: pure functions for scales, ticks, number and date formats, curves, stacks and decimation, the chart frame (size, legend, tooltip, "No data", skeleton, accessibility) and the axes. The charts use it; you can build your own chart on it too.
4
+
5
+ ```ts
6
+ import { linearScale, niceDomain, chartNumberFormatter, TxChartSeries } from '@tectra-ng/charts/core';
7
+ ```
8
+
9
+ ## Scales and ticks
10
+
11
+ | Function | What it does |
12
+ |---|---|
13
+ | `linearScale(domain, range)` | Maps numbers to pixels: `map`, `invert`, `ticks(count)` |
14
+ | `logScale(domain, range)` | Logarithmic scale; ticks are powers of ten (and 2 / 5 between them when there is room) |
15
+ | `timeScale(domain, range)` | Time in ms; `ticks(count)` and `interval(count)` pick calendar steps — seconds, minutes, hours, days, weeks, months, years |
16
+ | `bandScale(count, range, paddingInner?, paddingOuter?)` | Equal bands for categories: `start`, `center`, `bandwidth`, `indexAt` |
17
+ | `pointScale(count, range)` | Evenly spaced points from edge to edge: `at`, `indexAt` |
18
+ | `niceDomain(min, max, count?)` | Widens a range to round numbers (`[3, 97]` → `[0, 100]`) |
19
+ | `linearTicks(min, max, count?)`, `tickStep`, `logTicks`, `timeTicks` | Round tick values |
20
+ | `toTime(value)` | ISO string (a date-only string is local midnight), `Date` or timestamp → ms |
21
+
22
+ ## Formats
23
+
24
+ | Function | What it does |
25
+ |---|---|
26
+ | `chartNumberFormatter(intl, format)` | `number` (up to 2 decimals), `integer`, `compact` (`1.2K`), `percent` or your function → `(value) => string` |
27
+ | `tickFormatter(intl, ticks, format)` | Like the above with as many decimals as the tick step needs |
28
+ | `compactNumber(value, intl?)` | `1234567` → `1.2M` |
29
+ | `timeTickFormatter(intl, interval, span)`, `timeTooltipFormatter(intl, interval)` | Dates for ticks and tooltips through `Intl.DateTimeFormat` |
30
+ | `chartMonthNames(intl, 'long' \| 'short')` | 12 capitalised month names |
31
+ | `textWidth(text, fontSize)`, `truncateText(text, maxWidth, fontSize)` | Text width estimate that gives the same layout on the server and in the browser |
32
+
33
+ ## Shapes, stacks, data
34
+
35
+ | Function | What it does |
36
+ |---|---|
37
+ | `linePath(points, curve)`, `areaPath(top, bottom, curve)` | SVG paths; `null` points split the path; curves `smooth` (monotone), `straight`, `step` |
38
+ | `stackValues(series, 'normal' \| '100%')` | `[from, to]` per value; positive and negative values stack apart |
39
+ | `largestTriangleThreeBuckets(points, threshold)`, `decimateSeries(points, threshold)` | Thin long series and keep their shape |
40
+ | `normalizeSeries(series, categories, xType)` | Turns `TxChartSeries[]` into labels, x values and a value table |
41
+ | `cartesianLayout(options)` | Plot area, value and category scales, tick labels (skipped or rotated when they collide), grid and zero line |
42
+ | `chartColor(index)`, `chartPalette(count?)`, `seriesColor(color, index)` | The series palette as `var(--tx-chart-series-colorN)` |
43
+
44
+ ## Components
45
+
46
+ | Name | What it is |
47
+ |---|---|
48
+ | `TxChartFrame` (`tx-chart-frame`) | The box of a chart: measures itself after hydration, places the legend, shows the tooltip on the kit overlay (beside the mouse cursor with the arrow at it, following it; for a touch or the keyboard pinned to the data with an arrow, on the side the data gives), "No data", the skeleton, the summary and the hidden data table, and forwards pointer and arrow-key events; with `zoomable` it also turns Ctrl + wheel, pinches and sideways swipes into `zoomed` / `panned` and shows a "Reset zoom" button while `zoomedIn` |
49
+ | `TxChartAxes` (`g[tx-chart-axes]`) | Grid, zero line, tick labels and titles from `cartesianLayout().axes` |
50
+ | `TxChartLegend` (`tx-chart-legend`) | Legend items that toggle series; arrow keys move between them; variants `dot`, `line`, `pill` and `stat` (a value in large type) |
51
+ | `TxChartAnnotations` (`g[tx-chart-annotations]`), `chartAnnotationShapes(list, mapping)`, `TxChartAnnotation` | Lines, bands and points with labels on a cartesian chart: the chart maps x and y to pixels, the core places shapes and label pills inside the plot (`chart.annotation` tokens) |
52
+ | `TxChartHoverBand` (`g[tx-chart-hover-band]`), `chartBandRect(band, index, plot, horizontal?)` | The soft band under the hovered category of a bar-like chart; it fades in and slides between categories (`chart.hoverBand` tokens) |
53
+ | `TxChartTooltipTemplate` (`ng-template[txChartTooltip]`) | Own tooltip content in any chart |
54
+ | `TxChartLegendTemplate` (`ng-template[txChartLegend]`) | Own legend item in any chart |
55
+
56
+ ## Types
57
+
58
+ `TxChartSeries` (`name`, `data` — numbers or `{ x, y }` points, `color?`), `TxChartValueFormat`, `TxChartTooltipFormatter` (`(value, { seriesIndex, dataPointIndex }) => string`), `TxChartLegendItem`, `TxChartTooltipData`, `TxChartLegendPosition`, `TxChartHeight`.
59
+
60
+ ## Notes
61
+
62
+ Texts ("No data", the summary, the data table, announcements) come from the kit locale (`chartNoData`, `chartSummary`, …) and numbers and dates from `Intl` with the locale's `intl` code. The tokens are the `chart` group of `@tectra-ng/themes`.