@tectra-ng/charts 0.1.9 → 0.2.1
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 +21 -1
- package/bar-list/README.md +30 -0
- package/boxplot/README.md +62 -0
- package/bullet/README.md +53 -0
- package/candlestick/README.md +57 -0
- package/column/README.md +4 -2
- package/combo/README.md +83 -0
- package/core/README.md +3 -1
- package/fesm2022/tectra-ng-charts-bar-list.mjs +299 -0
- package/fesm2022/tectra-ng-charts-bar-list.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-boxplot.mjs +887 -0
- package/fesm2022/tectra-ng-charts-boxplot.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-bullet.mjs +666 -0
- package/fesm2022/tectra-ng-charts-bullet.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-candlestick.mjs +778 -0
- package/fesm2022/tectra-ng-charts-candlestick.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-column.mjs +149 -66
- package/fesm2022/tectra-ng-charts-column.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-combo.mjs +1218 -0
- package/fesm2022/tectra-ng-charts-combo.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-core.mjs +1334 -49
- package/fesm2022/tectra-ng-charts-core.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-funnel.mjs +694 -0
- package/fesm2022/tectra-ng-charts-funnel.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-gantt.mjs +947 -0
- package/fesm2022/tectra-ng-charts-gantt.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-gauge.mjs +693 -0
- package/fesm2022/tectra-ng-charts-gauge.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-heatmap.mjs +935 -0
- package/fesm2022/tectra-ng-charts-heatmap.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-line.mjs +527 -67
- package/fesm2022/tectra-ng-charts-line.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-org-chart.mjs +2341 -0
- package/fesm2022/tectra-ng-charts-org-chart.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-pie.mjs +47 -86
- package/fesm2022/tectra-ng-charts-pie.mjs.map +1 -1
- package/fesm2022/tectra-ng-charts-radar.mjs +924 -0
- package/fesm2022/tectra-ng-charts-radar.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-radial-bar.mjs +802 -0
- package/fesm2022/tectra-ng-charts-radial-bar.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-range-area.mjs +933 -0
- package/fesm2022/tectra-ng-charts-range-area.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-rank-line.mjs +660 -0
- package/fesm2022/tectra-ng-charts-rank-line.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-sankey.mjs +837 -0
- package/fesm2022/tectra-ng-charts-sankey.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-scatter.mjs +1174 -0
- package/fesm2022/tectra-ng-charts-scatter.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-segmented-bar.mjs +328 -0
- package/fesm2022/tectra-ng-charts-segmented-bar.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-sunburst.mjs +733 -0
- package/fesm2022/tectra-ng-charts-sunburst.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-treemap.mjs +674 -0
- package/fesm2022/tectra-ng-charts-treemap.mjs.map +1 -0
- package/fesm2022/tectra-ng-charts-waterfall.mjs +809 -0
- package/fesm2022/tectra-ng-charts-waterfall.mjs.map +1 -0
- package/funnel/README.md +53 -0
- package/gantt/README.md +53 -0
- package/gauge/README.md +41 -0
- package/heatmap/README.md +47 -0
- package/line/README.md +13 -2
- package/org-chart/README.md +57 -0
- package/package.json +114 -6
- package/pie/README.md +1 -0
- package/radar/README.md +64 -0
- package/radial-bar/README.md +62 -0
- package/range-area/README.md +66 -0
- package/rank-line/README.md +51 -0
- package/sankey/README.md +52 -0
- package/scatter/README.md +71 -0
- package/segmented-bar/README.md +35 -0
- package/sunburst/README.md +55 -0
- package/treemap/README.md +47 -0
- package/types/tectra-ng-charts-bar-list.d.ts +724 -0
- package/types/tectra-ng-charts-bar-list.d.ts.map +1 -0
- package/types/tectra-ng-charts-boxplot.d.ts +882 -0
- package/types/tectra-ng-charts-boxplot.d.ts.map +1 -0
- package/types/tectra-ng-charts-bullet.d.ts +833 -0
- package/types/tectra-ng-charts-bullet.d.ts.map +1 -0
- package/types/tectra-ng-charts-candlestick.d.ts +854 -0
- package/types/tectra-ng-charts-candlestick.d.ts.map +1 -0
- package/types/tectra-ng-charts-column.d.ts +486 -3
- package/types/tectra-ng-charts-column.d.ts.map +1 -1
- package/types/tectra-ng-charts-combo.d.ts +987 -0
- package/types/tectra-ng-charts-combo.d.ts.map +1 -0
- package/types/tectra-ng-charts-core.d.ts +266 -5
- package/types/tectra-ng-charts-core.d.ts.map +1 -1
- package/types/tectra-ng-charts-funnel.d.ts +857 -0
- package/types/tectra-ng-charts-funnel.d.ts.map +1 -0
- package/types/tectra-ng-charts-gantt.d.ts +884 -0
- package/types/tectra-ng-charts-gantt.d.ts.map +1 -0
- package/types/tectra-ng-charts-gauge.d.ts +859 -0
- package/types/tectra-ng-charts-gauge.d.ts.map +1 -0
- package/types/tectra-ng-charts-heatmap.d.ts +914 -0
- package/types/tectra-ng-charts-heatmap.d.ts.map +1 -0
- package/types/tectra-ng-charts-line.d.ts +556 -2
- package/types/tectra-ng-charts-line.d.ts.map +1 -1
- package/types/tectra-ng-charts-org-chart.d.ts +1017 -0
- package/types/tectra-ng-charts-org-chart.d.ts.map +1 -0
- package/types/tectra-ng-charts-pie.d.ts +477 -14
- package/types/tectra-ng-charts-pie.d.ts.map +1 -1
- package/types/tectra-ng-charts-radar.d.ts +903 -0
- package/types/tectra-ng-charts-radar.d.ts.map +1 -0
- package/types/tectra-ng-charts-radial-bar.d.ts +886 -0
- package/types/tectra-ng-charts-radial-bar.d.ts.map +1 -0
- package/types/tectra-ng-charts-range-area.d.ts +897 -0
- package/types/tectra-ng-charts-range-area.d.ts.map +1 -0
- package/types/tectra-ng-charts-rank-line.d.ts +839 -0
- package/types/tectra-ng-charts-rank-line.d.ts.map +1 -0
- package/types/tectra-ng-charts-sankey.d.ts +866 -0
- package/types/tectra-ng-charts-sankey.d.ts.map +1 -0
- package/types/tectra-ng-charts-scatter.d.ts +987 -0
- package/types/tectra-ng-charts-scatter.d.ts.map +1 -0
- package/types/tectra-ng-charts-segmented-bar.d.ts +751 -0
- package/types/tectra-ng-charts-segmented-bar.d.ts.map +1 -0
- package/types/tectra-ng-charts-sunburst.d.ts +864 -0
- package/types/tectra-ng-charts-sunburst.d.ts.map +1 -0
- package/types/tectra-ng-charts-treemap.d.ts +847 -0
- package/types/tectra-ng-charts-treemap.d.ts.map +1 -0
- package/types/tectra-ng-charts-waterfall.d.ts +869 -0
- package/types/tectra-ng-charts-waterfall.d.ts.map +1 -0
- package/waterfall/README.md +60 -0
package/README.md
CHANGED
|
@@ -12,7 +12,27 @@ Part of `tectra-ng`. One entry point per chart, so you only bundle what you impo
|
|
|
12
12
|
|---|---|
|
|
13
13
|
| `@tectra-ng/charts/line` | `<tx-line-chart>` — line and area, stacked and 100%, time axis, gaps, decimation |
|
|
14
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 |
|
|
15
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 |
|
|
16
36
|
| `@tectra-ng/charts/core` | scales, ticks, formats, curves, stacks, the chart frame, axes and legend — for your own charts |
|
|
17
37
|
|
|
18
38
|
```ts
|
|
@@ -23,4 +43,4 @@ import { TxLineChart } from '@tectra-ng/charts/line';
|
|
|
23
43
|
<tx-line-chart [series]="[{ name: 'Visits', data: [120, 180, 150] }]" [categories]="['Mon', 'Tue', 'Wed']" />
|
|
24
44
|
```
|
|
25
45
|
|
|
26
|
-
Peer dependencies: `@angular/core`, `@angular/common`, `@angular/cdk`, `@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).
|
|
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.
|
package/bullet/README.md
ADDED
|
@@ -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.
|
package/column/README.md
CHANGED
|
@@ -15,6 +15,7 @@ import { TxColumnChart } from '@tectra-ng/charts/column';
|
|
|
15
15
|
|---|---|
|
|
16
16
|
| series | `{ name, data, color? }[]` — one number (or `null`) per category. An empty list shows "No data" |
|
|
17
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 |
|
|
18
19
|
| stacked | Stacks the series (default); `false` groups them side by side |
|
|
19
20
|
| stackType | `normal` or `100%` (every category to 100%; also turns stacking on) |
|
|
20
21
|
| height | Height in px (350), or a CSS size such as `'100%'` of a parent with a definite height |
|
|
@@ -38,10 +39,11 @@ import { TxColumnChart } from '@tectra-ng/charts/column';
|
|
|
38
39
|
| yAxisPosition | Side of the vertical axis: `left` or `right` |
|
|
39
40
|
| labelMode | Category labels that do not fit: `auto`, `rotate` or `skip` |
|
|
40
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 |
|
|
41
43
|
| loading | Shows a skeleton of the same size |
|
|
42
44
|
| ariaLabel | What the chart shows; starts the summary read by screen readers |
|
|
43
45
|
| dt | Design tokens of this chart (`chart`) — bar radius, width and gap, palette, labels |
|
|
44
|
-
| pt | Classes and styles of the parts: `root`, `legend`, `legendItem`, `plot`, `svg`, `grid`, `axis`, `bar`, `dataLabel`, `tooltip`, `empty`, `skeleton` |
|
|
46
|
+
| pt | Classes and styles of the parts: `root`, `hoverBand`, `annotation`, `legend`, `legendItem`, `plot`, `svg`, `grid`, `axis`, `bar`, `dataLabel`, `tooltip`, `empty`, `skeleton` |
|
|
45
47
|
| ptOptions | How `pt` merges with the global pass-through |
|
|
46
48
|
| unstyled | Removes the tectra styles and keeps the behaviour |
|
|
47
49
|
|
|
@@ -68,4 +70,4 @@ import { TxColumnChart } from '@tectra-ng/charts/column';
|
|
|
68
70
|
|
|
69
71
|
## Notes
|
|
70
72
|
|
|
71
|
-
Hovering a
|
|
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.
|
package/combo/README.md
ADDED
|
@@ -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
CHANGED
|
@@ -45,9 +45,11 @@ import { linearScale, niceDomain, chartNumberFormatter, TxChartSeries } from '@t
|
|
|
45
45
|
|
|
46
46
|
| Name | What it is |
|
|
47
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 (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 |
|
|
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
49
|
| `TxChartAxes` (`g[tx-chart-axes]`) | Grid, zero line, tick labels and titles from `cartesianLayout().axes` |
|
|
50
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) |
|
|
51
53
|
| `TxChartTooltipTemplate` (`ng-template[txChartTooltip]`) | Own tooltip content in any chart |
|
|
52
54
|
| `TxChartLegendTemplate` (`ng-template[txChartLegend]`) | Own legend item in any chart |
|
|
53
55
|
|