@ember-lattice/charts 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/LICENSE.md +21 -0
- package/NOTICE +30 -0
- package/README.md +56 -2
- package/addon-main.cjs +4 -0
- package/declarations/index.d.ts +7 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/lattice-chart.d.ts +69 -0
- package/declarations/lattice-chart.d.ts.map +1 -0
- package/declarations/range-chart.d.ts +32 -0
- package/declarations/range-chart.d.ts.map +1 -0
- package/declarations/sparkline.d.ts +56 -0
- package/declarations/sparkline.d.ts.map +1 -0
- package/dist/index.js +272 -0
- package/dist/index.js.map +1 -0
- package/package.json +89 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @ember-lattice/charts
|
|
2
|
+
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 7ce4af2: Lattice 1.0: one grid for every collection in Ember. Lists, feeds, tables, boards and
|
|
8
|
+
spreadsheets come from one headless engine, a port of TanStack Table. It has 80 of the 81
|
|
9
|
+
AG Grid features in the parity matrix; the external filter runs after grouping. The release has the client row models, the Lattice wire protocol with servers for Node,
|
|
10
|
+
Rails and Python, an IronCalc spreadsheet with live collaboration, themes, test harnesses, Jig
|
|
11
|
+
stories and Marquetry catalog entries.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [7ce4af2]
|
|
16
|
+
- @ember-lattice/core@1.0.0
|
|
17
|
+
- @ember-lattice/ember@1.0.0
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joe Gaudet
|
|
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/NOTICE
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Lattice
|
|
2
|
+
Copyright (c) 2026 Joe Gaudet. MIT licensed; see LICENSE.md.
|
|
3
|
+
|
|
4
|
+
Lattice ports code from two MIT-licensed TanStack projects into Ember-native code. Lattice does
|
|
5
|
+
not depend on either package. PORT_MAP.md names each ported file and its source.
|
|
6
|
+
|
|
7
|
+
TanStack Table (@tanstack/table-core 9.3.1)
|
|
8
|
+
https://github.com/TanStack/table
|
|
9
|
+
Copyright (c) 2016 Tanner Linsley
|
|
10
|
+
|
|
11
|
+
TanStack Virtual (@tanstack/virtual-core 3.19.16)
|
|
12
|
+
https://github.com/TanStack/virtual
|
|
13
|
+
Copyright (c) 2021-present Tanner Linsley
|
|
14
|
+
|
|
15
|
+
Both are licensed under the MIT License:
|
|
16
|
+
|
|
17
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
18
|
+
and associated documentation files (the "Software"), to deal in the Software without
|
|
19
|
+
restriction, including without limitation the rights to use, copy, modify, merge, publish,
|
|
20
|
+
distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
|
|
21
|
+
Software is furnished to do so, subject to the following conditions:
|
|
22
|
+
|
|
23
|
+
The above copyright notice and this permission notice shall be included in all copies or
|
|
24
|
+
substantial portions of the Software.
|
|
25
|
+
|
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
|
27
|
+
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
28
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
29
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,57 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ember-lattice/charts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Sparklines and integrated charts for Lattice, through the Joinery chart add-on.
|
|
4
|
+
|
|
5
|
+
Part of [Lattice](https://joegaudet.com/ember-lattice/). Not released yet.
|
|
6
|
+
|
|
7
|
+
## Sparklines
|
|
8
|
+
|
|
9
|
+
`LineSparkline`, `AreaSparkline`, `ColumnSparkline` and `BarSparkline` are full cells for
|
|
10
|
+
`LatticeGrid`. The cell value must be an array of numbers. The cell ignores the other items.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { LineSparkline } from '@ember-lattice/charts'
|
|
14
|
+
|
|
15
|
+
const column = {
|
|
16
|
+
id: 'trend',
|
|
17
|
+
header: 'Trend',
|
|
18
|
+
accessorKey: 'trend',
|
|
19
|
+
meta: { lattice: { cell: LineSparkline, cellKind: 'cheap' } },
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
- Each sparkline is an SVG with `role="img"`. Its `aria-label` tells the minimum, the maximum and
|
|
24
|
+
the last value, for example `Trend: minimum 1, maximum 9, last 5`.
|
|
25
|
+
- A sparkline keeps no state, so `cellKind: 'cheap'` is correct.
|
|
26
|
+
- A column or a bar starts at the zero line. A negative value goes down (a column) or to the
|
|
27
|
+
left (a bar).
|
|
28
|
+
- The color is `--chart-1`.
|
|
29
|
+
- 1,000 line sparklines of 20 points render in about 70 ms (Chrome, Apple M4).
|
|
30
|
+
|
|
31
|
+
`Sparkline` is the base component. It takes `@value` and `@type`.
|
|
32
|
+
|
|
33
|
+
## LatticeChart
|
|
34
|
+
|
|
35
|
+
`LatticeChart` draws the rows of a table with `@ember-joinery/chart`.
|
|
36
|
+
|
|
37
|
+
```gts
|
|
38
|
+
import { LatticeChart } from '@ember-lattice/charts'
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<LatticeChart
|
|
42
|
+
@table={{table}}
|
|
43
|
+
@columns={{array 'sales' 'cost'}}
|
|
44
|
+
@type='line'
|
|
45
|
+
@label='Sales by month'
|
|
46
|
+
/>
|
|
47
|
+
</template>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
| Argument | Effect |
|
|
51
|
+
| ----------- | ------------------------------------------------------------------------- |
|
|
52
|
+
| `@table` | The table. The chart follows its current rows: sort, filter and group. |
|
|
53
|
+
| `@columns` | The ids of the number columns. Each column is one series. |
|
|
54
|
+
| `@type` | `line`, `area` or `bar`. |
|
|
55
|
+
| `@label` | The caption and the SVG title. It is necessary for accessibility. |
|
|
56
|
+
| `@category` | The column of the x-axis labels. Default: the first other visible column. |
|
|
57
|
+
| `@rowIds` | A selected range: only these rows, in table order. |
|
package/addon-main.cjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { AreaSparkline, BarSparkline, ColumnSparkline, LineSparkline, Sparkline, sparklineLabel, } from './sparkline';
|
|
2
|
+
export type { SparklineSignature, SparklineType } from './sparkline';
|
|
3
|
+
export { default as LatticeChart } from './lattice-chart';
|
|
4
|
+
export type { ChartColumn, ChartRow, ChartTable, LatticeChartSignature, LatticeChartType, } from './lattice-chart';
|
|
5
|
+
export { RangeChart, rangeChartArgs } from './range-chart';
|
|
6
|
+
export type { ChartRangeTable, RangeChartSignature } from './range-chart';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC7D,YAAY,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC9D,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type { LatticeLocaleTextOverride } from '@ember-lattice/core';
|
|
3
|
+
import type { ChartConfig } from '@ember-joinery/chart';
|
|
4
|
+
/** The parts of a `@ember-lattice/core` table that the chart reads. */
|
|
5
|
+
export interface ChartColumn {
|
|
6
|
+
id: string;
|
|
7
|
+
columnDef: {
|
|
8
|
+
header?: unknown;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface ChartRow {
|
|
12
|
+
id: string;
|
|
13
|
+
getValue(columnId: string): unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface ChartTable {
|
|
16
|
+
getRowModel(): {
|
|
17
|
+
rows: ReadonlyArray<ChartRow>;
|
|
18
|
+
};
|
|
19
|
+
getAllLeafColumns(): ReadonlyArray<ChartColumn>;
|
|
20
|
+
getVisibleLeafColumns?(): ReadonlyArray<ChartColumn>;
|
|
21
|
+
}
|
|
22
|
+
export type LatticeChartType = 'line' | 'area' | 'bar';
|
|
23
|
+
export interface LatticeChartSignature {
|
|
24
|
+
Args: {
|
|
25
|
+
table: ChartTable;
|
|
26
|
+
/** The ids of the number columns: one series for each. */
|
|
27
|
+
columns: ReadonlyArray<string>;
|
|
28
|
+
type: LatticeChartType;
|
|
29
|
+
/** The chart's name: the caption and the SVG title. */
|
|
30
|
+
label: string;
|
|
31
|
+
/** The column of the x-axis labels. Default: the first visible column not in `columns`. */
|
|
32
|
+
category?: string;
|
|
33
|
+
/** A selected range: only these rows, in table order. Default: all the current rows. */
|
|
34
|
+
rowIds?: ReadonlyArray<string>;
|
|
35
|
+
/** Locale text that replaces the owner text for this chart. */
|
|
36
|
+
localeText?: LatticeLocaleTextOverride;
|
|
37
|
+
/** The locale of the description and the numbers. Default: the owner locale. */
|
|
38
|
+
locale?: string;
|
|
39
|
+
};
|
|
40
|
+
Element: HTMLElement;
|
|
41
|
+
}
|
|
42
|
+
export default class LatticeChart extends Component<LatticeChartSignature> {
|
|
43
|
+
CATEGORY: string;
|
|
44
|
+
HIDDEN: import("@ember/template").TrustedHTML;
|
|
45
|
+
captionId: string;
|
|
46
|
+
get l(): import("@ember-lattice/core").LatticeLocale;
|
|
47
|
+
/** The header text of a column, or its id. */
|
|
48
|
+
headerOf: (id: string) => string;
|
|
49
|
+
get seriesNames(): string[];
|
|
50
|
+
get categoryName(): string;
|
|
51
|
+
/** The SVG `<desc>`: the kind, the series, the category and the number of points. */
|
|
52
|
+
get description(): string;
|
|
53
|
+
/** The rows of the data table: the category, then a text for each series. */
|
|
54
|
+
get tableRows(): {
|
|
55
|
+
category: string;
|
|
56
|
+
values: string[];
|
|
57
|
+
}[];
|
|
58
|
+
get columns(): readonly ChartColumn[];
|
|
59
|
+
get category(): string | undefined;
|
|
60
|
+
get config(): ChartConfig;
|
|
61
|
+
get series(): {
|
|
62
|
+
key: string;
|
|
63
|
+
color: string;
|
|
64
|
+
}[];
|
|
65
|
+
get data(): Record<string, unknown>[];
|
|
66
|
+
get isBar(): boolean;
|
|
67
|
+
get isArea(): boolean;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=lattice-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lattice-chart.d.ts","sourceRoot":"","sources":["../src/lattice-chart.gts"],"names":[],"mappings":"AA0NA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAM1C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAEpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEvD,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAChC;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAA;CACpC;AAED,MAAM,WAAW,UAAU;IACzB,WAAW,IAAI;QAAE,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;KAAE,CAAA;IAChD,iBAAiB,IAAI,aAAa,CAAC,WAAW,CAAC,CAAA;IAC/C,qBAAqB,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC,CAAA;CACrD;AAED,MAAM,MAAM,gBAAgB,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component';
|
|
2
|
+
import type { GridRange } from '@ember-lattice/ember';
|
|
3
|
+
import type { ChartColumn, ChartTable, LatticeChartType } from './lattice-chart';
|
|
4
|
+
/** A table with the parts that a range needs: the cell selection and the pinned column order. */
|
|
5
|
+
export interface ChartRangeTable extends ChartTable {
|
|
6
|
+
getCellSelectionBounds?(): ReadonlyArray<GridRange>;
|
|
7
|
+
getStartVisibleLeafColumns?(): ReadonlyArray<ChartColumn>;
|
|
8
|
+
getCenterVisibleLeafColumns?(): ReadonlyArray<ChartColumn>;
|
|
9
|
+
getEndVisibleLeafColumns?(): ReadonlyArray<ChartColumn>;
|
|
10
|
+
}
|
|
11
|
+
export interface RangeChartArgs {
|
|
12
|
+
rowIds: string[];
|
|
13
|
+
columns: string[];
|
|
14
|
+
category: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
/** The `LatticeChart` args of a range: its row IDs, its number columns and its category. */
|
|
17
|
+
export declare function rangeChartArgs(table: ChartRangeTable, range: GridRange): RangeChartArgs;
|
|
18
|
+
export interface RangeChartSignature {
|
|
19
|
+
Args: {
|
|
20
|
+
table: ChartRangeTable;
|
|
21
|
+
type: LatticeChartType;
|
|
22
|
+
label: string;
|
|
23
|
+
/** The range. Default: the last range of the table cell selection. */
|
|
24
|
+
range?: GridRange;
|
|
25
|
+
};
|
|
26
|
+
Element: HTMLElement;
|
|
27
|
+
}
|
|
28
|
+
export declare class RangeChart extends Component<RangeChartSignature> {
|
|
29
|
+
get range(): GridRange | undefined;
|
|
30
|
+
get chart(): RangeChartArgs | undefined;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=range-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range-chart.d.ts","sourceRoot":"","sources":["../src/range-chart.gts"],"names":[],"mappings":"AA2FA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEpF,iGAAiG;AACjG,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,sBAAsB,CAAC,IAAI,aAAa,CAAC,SAAS,CAAC,CAAA;IACnD,0BAA0B,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC,CAAA;IACzD,2BAA2B,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC,CAAA;IAC1D,wBAAwB,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC,CAAA;CACxD;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B;AAeD,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS,GAAG,cAAc,CAcvF;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE;QACJ,KAAK,EAAE,eAAe,CAAA;QACtB,IAAI,EAAE,gBAAgB,CAAA;QACtB,KAAK,EAAE,MAAM,CAAA;QACb,sEAAsE;QACtE,KAAK,CAAC,EAAE,SAAS,CAAA;KAClB,CAAA;IACD,OAAO,EAAE,WAAW,CAAA;CACrB;AAED,qBAAa,UAAW,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IAC5D,IAAI,KAAK,IAAI,SAAS,GAAG,SAAS,CAEjC;IAED,IAAI,KAAK,IAAI,cAAc,GAAG,SAAS,CAGtC;CAiBF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import type { TOC } from '@ember/component/template-only';
|
|
3
|
+
import type { LatticeLocale, LatticeLocaleTextOverride } from '@ember-lattice/core';
|
|
4
|
+
export type SparklineType = 'line' | 'area' | 'bar' | 'column';
|
|
5
|
+
export interface SparklineSignature {
|
|
6
|
+
Args: {
|
|
7
|
+
/** An array of numbers. Other items are ignored. */
|
|
8
|
+
value: unknown;
|
|
9
|
+
type?: SparklineType;
|
|
10
|
+
/** Locale text that replaces the owner text for this sparkline. */
|
|
11
|
+
localeText?: LatticeLocaleTextOverride;
|
|
12
|
+
/** The locale of the numbers. Default: the owner locale. */
|
|
13
|
+
locale?: string;
|
|
14
|
+
};
|
|
15
|
+
Element: SVGSVGElement;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The accessible name of a sparkline: the minimum, the maximum and the last value, in the locale
|
|
19
|
+
* (default: the English text and the runtime locale).
|
|
20
|
+
*/
|
|
21
|
+
export declare function sparklineLabel(value: unknown, l?: LatticeLocale): string;
|
|
22
|
+
interface Rect {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
}
|
|
28
|
+
export declare class Sparkline extends Component<SparklineSignature> {
|
|
29
|
+
get nums(): number[];
|
|
30
|
+
get type(): SparklineType;
|
|
31
|
+
get label(): string;
|
|
32
|
+
get isLinear(): boolean;
|
|
33
|
+
get points(): Array<[number, number]>;
|
|
34
|
+
/** One value has no line: it shows as a dot. */
|
|
35
|
+
get dot(): {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
} | undefined;
|
|
39
|
+
get linePath(): string | undefined;
|
|
40
|
+
get areaPath(): string | undefined;
|
|
41
|
+
/** Columns go up (or down) from the zero line; bars go right (or left) from it. */
|
|
42
|
+
get rects(): Rect[];
|
|
43
|
+
}
|
|
44
|
+
/** The cell signature: a full cell of `LatticeGrid` gets more arguments; it reads `value`. */
|
|
45
|
+
interface CellSignature {
|
|
46
|
+
Args: {
|
|
47
|
+
value: unknown;
|
|
48
|
+
};
|
|
49
|
+
Element: SVGSVGElement;
|
|
50
|
+
}
|
|
51
|
+
export declare const LineSparkline: TOC<CellSignature>;
|
|
52
|
+
export declare const AreaSparkline: TOC<CellSignature>;
|
|
53
|
+
export declare const BarSparkline: TOC<CellSignature>;
|
|
54
|
+
export declare const ColumnSparkline: TOC<CellSignature>;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=sparkline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparkline.d.ts","sourceRoot":"","sources":["../src/sparkline.gts"],"names":[],"mappings":"AAqMA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAG1C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAA;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAEnF,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE9D,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE;QACJ,oDAAoD;QACpD,KAAK,EAAE,OAAO,CAAA;QACd,IAAI,CAAC,EAAE,aAAa,CAAA;QACpB,mEAAmE;QACnE,UAAU,CAAC,EAAE,yBAAyB,CAAA;QACtC,4DAA4D;QAC5D,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,OAAO,EAAE,aAAa,CAAA;CACvB;AASD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,CAAC,GAAE,aAAwC,GAC1C,MAAM,CAQR;AAED,UAAU,IAAI;IACZ,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAMD,qBAAa,SAAU,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IAC1D,IAAI,IAAI,aAEP;IAED,IAAI,IAAI,IAAI,aAAa,CAExB;IAED,IAAI,KAAK,WAKR;IAED,IAAI,QAAQ,YAEX;IAED,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAKpC;IAED,gDAAgD;IAChD,IAAI,GAAG;;;kBAGN;IAED,IAAI,QAAQ,uBAGX;IAED,IAAI,QAAQ,uBAKX;IAED,mFAAmF;IACnF,IAAI,KAAK,IAAI,IAAI,EAAE,CAkBlB;CAsHF;AAED,8FAA8F;AAC9F,UAAU,aAAa;IACrB,IAAI,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;IACxB,OAAO,EAAE,aAAa,CAAA;CACvB;AAED,eAAO,MAAM,aAAa,EAAE,GAAG,CAAC,aAAa,CAQ3C,CAAA;AAEF,eAAO,MAAM,aAAa,EAAE,GAAG,CAAC,aAAa,CAQ3C,CAAA;AAEF,eAAO,MAAM,YAAY,EAAE,GAAG,CAAC,aAAa,CAQ1C,CAAA;AAEF,eAAO,MAAM,eAAe,EAAE,GAAG,CAAC,aAAa,CAQ7C,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { getOwner } from '@ember/owner';
|
|
3
|
+
import is from '@sindresorhus/is';
|
|
4
|
+
import { latticeLocale } from '@ember-lattice/core';
|
|
5
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
|
+
import { setComponentTemplate } from '@ember/component';
|
|
7
|
+
import templateOnly from '@ember/component/template-only';
|
|
8
|
+
import { guidFor } from '@ember/object/internals';
|
|
9
|
+
import { htmlSafe } from '@ember/template';
|
|
10
|
+
import { ChartContainer } from '@ember-joinery/chart';
|
|
11
|
+
|
|
12
|
+
// Sparklines: small SVG charts in a grid cell. They keep no state, so they are `cheap` cells
|
|
13
|
+
// that can reuse row slots. Put one in `meta.lattice.cell` of a column whose value is an array
|
|
14
|
+
// of numbers.
|
|
15
|
+
const W = 100;
|
|
16
|
+
const H = 24;
|
|
17
|
+
const PAD = 2;
|
|
18
|
+
const numbersOf = value => is.array(value) ? value.filter(v => is.number(v) && Number.isFinite(v)) : [];
|
|
19
|
+
/**
|
|
20
|
+
* The accessible name of a sparkline: the minimum, the maximum and the last value, in the locale
|
|
21
|
+
* (default: the English text and the runtime locale).
|
|
22
|
+
*/
|
|
23
|
+
function sparklineLabel(value, l = latticeLocale(undefined)) {
|
|
24
|
+
const nums = numbersOf(value);
|
|
25
|
+
if (nums.length === 0) return l.t('charts.sparkline.noData');
|
|
26
|
+
const number = new Intl.NumberFormat(l.locale, {
|
|
27
|
+
maximumFractionDigits: 2
|
|
28
|
+
});
|
|
29
|
+
const [min, max, last] = [Math.min(...nums), Math.max(...nums), nums.at(-1)].map(n => number.format(n));
|
|
30
|
+
return l.t('charts.sparkline.label', {
|
|
31
|
+
min: min,
|
|
32
|
+
max: max,
|
|
33
|
+
last: last
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** A linear scale from [lo, hi] to [to, from], flat in the middle when lo = hi. */const scale = (lo, hi, from, to) => v => hi === lo ? (from + to) / 2 : from + (hi - v) / (hi - lo) * (to - from);
|
|
37
|
+
class Sparkline extends Component {
|
|
38
|
+
get nums() {
|
|
39
|
+
return numbersOf(this.args.value);
|
|
40
|
+
}
|
|
41
|
+
get type() {
|
|
42
|
+
return this.args.type ?? 'line';
|
|
43
|
+
}
|
|
44
|
+
get label() {
|
|
45
|
+
return sparklineLabel(this.args.value, latticeLocale(getOwner(this), this.args.localeText, this.args.locale));
|
|
46
|
+
}
|
|
47
|
+
get isLinear() {
|
|
48
|
+
return this.type === 'line' || this.type === 'area';
|
|
49
|
+
}
|
|
50
|
+
get points() {
|
|
51
|
+
const nums = this.nums;
|
|
52
|
+
const y = scale(Math.min(...nums), Math.max(...nums), PAD, H - PAD);
|
|
53
|
+
const step = nums.length > 1 ? (W - 2 * PAD) / (nums.length - 1) : 0;
|
|
54
|
+
return nums.map((v, i) => [nums.length > 1 ? PAD + i * step : W / 2, y(v)]);
|
|
55
|
+
}
|
|
56
|
+
/** One value has no line: it shows as a dot. */
|
|
57
|
+
get dot() {
|
|
58
|
+
const [x, y] = this.points[0] ?? [0, 0];
|
|
59
|
+
return this.isLinear && this.nums.length === 1 ? {
|
|
60
|
+
x,
|
|
61
|
+
y
|
|
62
|
+
} : undefined;
|
|
63
|
+
}
|
|
64
|
+
get linePath() {
|
|
65
|
+
if (!this.isLinear || this.nums.length < 2) return undefined;
|
|
66
|
+
return 'M' + this.points.map(([x, y]) => `${x},${y}`).join('L');
|
|
67
|
+
}
|
|
68
|
+
get areaPath() {
|
|
69
|
+
const line = this.linePath;
|
|
70
|
+
if (this.type !== 'area' || !line) return undefined;
|
|
71
|
+
const xs = this.points.map(([x]) => x);
|
|
72
|
+
return `${line}L${xs.at(-1)},${H}L${xs[0]},${H}Z`;
|
|
73
|
+
}
|
|
74
|
+
/** Columns go up (or down) from the zero line; bars go right (or left) from it. */
|
|
75
|
+
get rects() {
|
|
76
|
+
if (this.isLinear) return [];
|
|
77
|
+
const nums = this.nums;
|
|
78
|
+
const lo = Math.min(0, ...nums);
|
|
79
|
+
const hi = Math.max(0, ...nums);
|
|
80
|
+
const columns = this.type === 'column';
|
|
81
|
+
const band = (columns ? W : H) / nums.length;
|
|
82
|
+
// For bars the value runs along x, so the scale goes from right to left.
|
|
83
|
+
const at = columns ? scale(lo, hi, PAD, H - PAD) : scale(lo, hi, W - PAD, PAD);
|
|
84
|
+
const zero = at(0);
|
|
85
|
+
return nums.map((v, i) => {
|
|
86
|
+
const start = Math.min(at(v), zero);
|
|
87
|
+
const length = Math.max(Math.abs(at(v) - zero), 0.5);
|
|
88
|
+
const across = i * band + band * 0.1;
|
|
89
|
+
return columns ? {
|
|
90
|
+
x: across,
|
|
91
|
+
y: start,
|
|
92
|
+
width: band * 0.8,
|
|
93
|
+
height: length
|
|
94
|
+
} : {
|
|
95
|
+
x: start,
|
|
96
|
+
y: across,
|
|
97
|
+
width: length,
|
|
98
|
+
height: band * 0.8
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
static {
|
|
103
|
+
setComponentTemplate(precompileTemplate("<svg class=\"lt-sparkline lt-sparkline-{{this.type}}\" role=\"img\" aria-label={{this.label}} viewBox=\"0 0 100 24\" preserveAspectRatio=\"none\" width=\"100%\" height=\"20\" style=\"display:block;color:var(--chart-1, currentColor)\" ...attributes>\n {{#if this.areaPath}}\n <path class=\"lt-sparkline-area\" d={{this.areaPath}} fill=\"currentColor\" fill-opacity=\"0.2\" stroke=\"none\" />\n {{/if}}\n {{#if this.linePath}}\n <path class=\"lt-sparkline-line\" d={{this.linePath}} fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" vector-effect=\"non-scaling-stroke\" />\n {{/if}}\n {{#if this.dot}}\n <circle cx={{this.dot.x}} cy={{this.dot.y}} r=\"2\" fill=\"currentColor\" />\n {{/if}}\n {{#each this.rects as |box|}}\n <rect x={{box.x}} y={{box.y}} width={{box.width}} height={{box.height}} fill=\"currentColor\" />\n {{/each}}\n</svg>", {
|
|
104
|
+
strictMode: true
|
|
105
|
+
}), this);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** The cell signature: a full cell of `LatticeGrid` gets more arguments; it reads `value`. */
|
|
109
|
+
|
|
110
|
+
const LineSparkline = setComponentTemplate(precompileTemplate("<Sparkline @value={{@value}} @type=\"line\" ...attributes />", {
|
|
111
|
+
strictMode: true,
|
|
112
|
+
scope: () => ({
|
|
113
|
+
Sparkline
|
|
114
|
+
})
|
|
115
|
+
}), templateOnly());
|
|
116
|
+
const AreaSparkline = setComponentTemplate(precompileTemplate("<Sparkline @value={{@value}} @type=\"area\" ...attributes />", {
|
|
117
|
+
strictMode: true,
|
|
118
|
+
scope: () => ({
|
|
119
|
+
Sparkline
|
|
120
|
+
})
|
|
121
|
+
}), templateOnly());
|
|
122
|
+
const BarSparkline = setComponentTemplate(precompileTemplate("<Sparkline @value={{@value}} @type=\"bar\" ...attributes />", {
|
|
123
|
+
strictMode: true,
|
|
124
|
+
scope: () => ({
|
|
125
|
+
Sparkline
|
|
126
|
+
})
|
|
127
|
+
}), templateOnly());
|
|
128
|
+
const ColumnSparkline = setComponentTemplate(precompileTemplate("<Sparkline @value={{@value}} @type=\"column\" ...attributes />", {
|
|
129
|
+
strictMode: true,
|
|
130
|
+
scope: () => ({
|
|
131
|
+
Sparkline
|
|
132
|
+
})
|
|
133
|
+
}), templateOnly());
|
|
134
|
+
|
|
135
|
+
// An integrated chart: the rows of a Lattice table, drawn by @ember-joinery/chart.
|
|
136
|
+
/** The data key of the x-axis labels. A column id cannot start with `__lattice`. */const CATEGORY = '__lattice_category';
|
|
137
|
+
/** The data table is for screen readers only: it is not visible. */
|
|
138
|
+
const HIDDEN = htmlSafe('position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap');
|
|
139
|
+
class LatticeChart extends Component {
|
|
140
|
+
CATEGORY = CATEGORY;
|
|
141
|
+
HIDDEN = HIDDEN;
|
|
142
|
+
captionId = `${guidFor(this)}-caption`;
|
|
143
|
+
get l() {
|
|
144
|
+
return latticeLocale(getOwner(this), this.args.localeText, this.args.locale);
|
|
145
|
+
}
|
|
146
|
+
/** The header text of a column, or its id. */
|
|
147
|
+
headerOf = id => {
|
|
148
|
+
const header = this.args.table.getAllLeafColumns().find(c => c.id === id)?.columnDef.header;
|
|
149
|
+
return is.string(header) ? header : id;
|
|
150
|
+
};
|
|
151
|
+
get seriesNames() {
|
|
152
|
+
return this.args.columns.map(this.headerOf);
|
|
153
|
+
}
|
|
154
|
+
get categoryName() {
|
|
155
|
+
const category = this.category;
|
|
156
|
+
return category ? this.headerOf(category) : this.l.t('charts.chart.category');
|
|
157
|
+
}
|
|
158
|
+
/** The SVG `<desc>`: the kind, the series, the category and the number of points. */
|
|
159
|
+
get description() {
|
|
160
|
+
const l = this.l;
|
|
161
|
+
return l.t('charts.chart.description', {
|
|
162
|
+
type: l.t(`charts.chart.${this.args.type}`),
|
|
163
|
+
series: new Intl.ListFormat(l.locale, {
|
|
164
|
+
type: 'conjunction'
|
|
165
|
+
}).format(this.seriesNames),
|
|
166
|
+
category: this.categoryName,
|
|
167
|
+
points: l.plural('charts.chart.points', this.data.length)
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/** The rows of the data table: the category, then a text for each series. */
|
|
171
|
+
get tableRows() {
|
|
172
|
+
const number = new Intl.NumberFormat(this.l.locale);
|
|
173
|
+
return this.data.map(datum => ({
|
|
174
|
+
category: String(datum[CATEGORY]),
|
|
175
|
+
values: this.args.columns.map(id => {
|
|
176
|
+
const value = datum[id];
|
|
177
|
+
return is.number(value) ? number.format(value) : '';
|
|
178
|
+
})
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
get columns() {
|
|
182
|
+
const table = this.args.table;
|
|
183
|
+
return table.getVisibleLeafColumns?.() ?? table.getAllLeafColumns();
|
|
184
|
+
}
|
|
185
|
+
get category() {
|
|
186
|
+
return this.args.category ?? this.columns.find(c => !this.args.columns.includes(c.id))?.id;
|
|
187
|
+
}
|
|
188
|
+
get config() {
|
|
189
|
+
const headers = new Map(this.args.table.getAllLeafColumns().map(c => [c.id, c.columnDef]));
|
|
190
|
+
return Object.fromEntries(this.args.columns.map((id, i) => {
|
|
191
|
+
const header = headers.get(id)?.header;
|
|
192
|
+
return [id, {
|
|
193
|
+
label: is.string(header) ? header : id,
|
|
194
|
+
color: `var(--chart-${i % 5 + 1})`
|
|
195
|
+
}];
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
get series() {
|
|
199
|
+
return this.args.columns.map(key => ({
|
|
200
|
+
key,
|
|
201
|
+
color: `var(--color-${key})`
|
|
202
|
+
}));
|
|
203
|
+
}
|
|
204
|
+
get data() {
|
|
205
|
+
const ids = this.args.rowIds ? new Set(this.args.rowIds) : undefined;
|
|
206
|
+
const category = this.category;
|
|
207
|
+
return this.args.table.getRowModel().rows.filter(row => !ids || ids.has(row.id)).map(row => {
|
|
208
|
+
const datum = {
|
|
209
|
+
[CATEGORY]: category ? String(row.getValue(category) ?? '') : row.id
|
|
210
|
+
};
|
|
211
|
+
for (const id of this.args.columns) {
|
|
212
|
+
const value = row.getValue(id);
|
|
213
|
+
datum[id] = is.number(value) ? value : null;
|
|
214
|
+
}
|
|
215
|
+
return datum;
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
get isBar() {
|
|
219
|
+
return this.args.type === 'bar';
|
|
220
|
+
}
|
|
221
|
+
get isArea() {
|
|
222
|
+
return this.args.type === 'area';
|
|
223
|
+
}
|
|
224
|
+
static {
|
|
225
|
+
setComponentTemplate(precompileTemplate("<figure class=\"lt-chart\" aria-labelledby={{this.captionId}} ...attributes>\n <figcaption class=\"lt-chart-caption\" id={{this.captionId}}>{{@label}}</figcaption>\n <ChartContainer @config={{this.config}} as |chart|>\n {{#if this.isBar}}\n <chart.BarChart @data={{this.data}} @title={{@label}} @desc={{this.description}} as |c|>\n <c.CartesianGrid @vertical={{false}} />\n <c.XAxis @dataKey={{this.CATEGORY}} />\n <c.YAxis />\n <c.ChartTooltip />\n {{#each this.series as |s|}}\n <c.Bar @dataKey={{s.key}} @fill={{s.color}} />\n {{/each}}\n </chart.BarChart>\n {{else if this.isArea}}\n <chart.AreaChart @data={{this.data}} @title={{@label}} @desc={{this.description}} as |c|>\n <c.CartesianGrid @vertical={{false}} />\n <c.XAxis @dataKey={{this.CATEGORY}} />\n <c.YAxis />\n <c.ChartTooltip />\n {{#each this.series as |s|}}\n <c.Area @dataKey={{s.key}} @fill={{s.color}} @stroke={{s.color}} />\n {{/each}}\n </chart.AreaChart>\n {{else}}\n <chart.LineChart @data={{this.data}} @title={{@label}} @desc={{this.description}} as |c|>\n <c.CartesianGrid @vertical={{false}} />\n <c.XAxis @dataKey={{this.CATEGORY}} />\n <c.YAxis />\n <c.ChartTooltip />\n {{#each this.series as |s|}}\n <c.Line @dataKey={{s.key}} @stroke={{s.color}} />\n {{/each}}\n </chart.LineChart>\n {{/if}}\n </ChartContainer>\n <table class=\"lt-chart-data\" style={{this.HIDDEN}}>\n <caption>{{@label}}</caption>\n <thead>\n <tr>\n <th scope=\"col\">{{this.categoryName}}</th>\n {{#each this.seriesNames as |name|}}\n <th scope=\"col\">{{name}}</th>\n {{/each}}\n </tr>\n </thead>\n <tbody>\n {{#each this.tableRows as |row|}}\n <tr>\n <th scope=\"row\">{{row.category}}</th>\n {{#each row.values as |value|}}\n <td>{{value}}</td>\n {{/each}}\n </tr>\n {{/each}}\n </tbody>\n </table>\n</figure>", {
|
|
226
|
+
strictMode: true,
|
|
227
|
+
scope: () => ({
|
|
228
|
+
ChartContainer
|
|
229
|
+
})
|
|
230
|
+
}), this);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Chart a range: a chart of the selected cells of a grid. The rows of the range are the points.
|
|
235
|
+
// The number columns of the range are the series, and the first other column is the x-axis.
|
|
236
|
+
// An app opens it from a context menu item (the `export` block of `GridContextMenu`).
|
|
237
|
+
/** The columns in the order of the grid: start pinned, center, end pinned. */function displayColumns(table) {
|
|
238
|
+
const center = table.getCenterVisibleLeafColumns?.() ?? table.getVisibleLeafColumns?.() ?? table.getAllLeafColumns();
|
|
239
|
+
return [...(table.getStartVisibleLeafColumns?.() ?? []), ...center, ...(table.getEndVisibleLeafColumns?.() ?? [])];
|
|
240
|
+
}
|
|
241
|
+
/** The `LatticeChart` args of a range: its row IDs, its number columns and its category. */
|
|
242
|
+
function rangeChartArgs(table, range) {
|
|
243
|
+
const rows = table.getRowModel().rows.slice(range.minRowIndex, range.maxRowIndex + 1);
|
|
244
|
+
const ids = displayColumns(table).slice(range.minColumnIndex, range.maxColumnIndex + 1).map(c => c.id);
|
|
245
|
+
// A column is a series when its values in the range are numbers (blanks are allowed).
|
|
246
|
+
const isNumber = id => rows.some(r => is.number(r.getValue(id))) && rows.every(r => is.number(r.getValue(id)) || is.nullOrUndefined(r.getValue(id)));
|
|
247
|
+
return {
|
|
248
|
+
rowIds: rows.map(r => r.id),
|
|
249
|
+
columns: ids.filter(isNumber),
|
|
250
|
+
category: ids.find(id => !isNumber(id))
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
class RangeChart extends Component {
|
|
254
|
+
get range() {
|
|
255
|
+
return this.args.range ?? this.args.table.getCellSelectionBounds?.().at(-1);
|
|
256
|
+
}
|
|
257
|
+
get chart() {
|
|
258
|
+
const range = this.range;
|
|
259
|
+
return range ? rangeChartArgs(this.args.table, range) : undefined;
|
|
260
|
+
}
|
|
261
|
+
static {
|
|
262
|
+
setComponentTemplate(precompileTemplate("{{#if this.chart}}\n <LatticeChart @table={{@table}} @columns={{this.chart.columns}} @rowIds={{this.chart.rowIds}} @category={{this.chart.category}} @type={{@type}} @label={{@label}} ...attributes />\n{{/if}}", {
|
|
263
|
+
strictMode: true,
|
|
264
|
+
scope: () => ({
|
|
265
|
+
LatticeChart
|
|
266
|
+
})
|
|
267
|
+
}), this);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export { AreaSparkline, BarSparkline, ColumnSparkline, LatticeChart, LineSparkline, RangeChart, Sparkline, rangeChartArgs, sparklineLabel };
|
|
272
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/sparkline.gts","../src/lattice-chart.gts","../src/range-chart.gts"],"sourcesContent":["// Sparklines: small SVG charts in a grid cell. They keep no state, so they are `cheap` cells\n// that can reuse row slots. Put one in `meta.lattice.cell` of a column whose value is an array\n// of numbers.\nimport Component from '@glimmer/component'\nimport { getOwner } from '@ember/owner'\nimport is from '@sindresorhus/is'\nimport type { TOC } from '@ember/component/template-only'\nimport { latticeLocale } from '@ember-lattice/core'\nimport type { LatticeLocale, LatticeLocaleTextOverride } from '@ember-lattice/core'\n\nexport type SparklineType = 'line' | 'area' | 'bar' | 'column'\n\nexport interface SparklineSignature {\n Args: {\n /** An array of numbers. Other items are ignored. */\n value: unknown\n type?: SparklineType\n /** Locale text that replaces the owner text for this sparkline. */\n localeText?: LatticeLocaleTextOverride\n /** The locale of the numbers. Default: the owner locale. */\n locale?: string\n }\n Element: SVGSVGElement\n}\n\nconst W = 100\nconst H = 24\nconst PAD = 2\n\nconst numbersOf = (value: unknown): number[] =>\n is.array(value) ? value.filter((v): v is number => is.number(v) && Number.isFinite(v)) : []\n\n/**\n * The accessible name of a sparkline: the minimum, the maximum and the last value, in the locale\n * (default: the English text and the runtime locale).\n */\nexport function sparklineLabel(\n value: unknown,\n l: LatticeLocale = latticeLocale(undefined),\n): string {\n const nums = numbersOf(value)\n if (nums.length === 0) return l.t('charts.sparkline.noData')\n const number = new Intl.NumberFormat(l.locale, { maximumFractionDigits: 2 })\n const [min, max, last] = [Math.min(...nums), Math.max(...nums), nums.at(-1)!].map(n =>\n number.format(n),\n )\n return l.t('charts.sparkline.label', { min: min!, max: max!, last: last! })\n}\n\ninterface Rect {\n x: number\n y: number\n width: number\n height: number\n}\n\n/** A linear scale from [lo, hi] to [to, from], flat in the middle when lo = hi. */\nconst scale = (lo: number, hi: number, from: number, to: number) => (v: number) =>\n hi === lo ? (from + to) / 2 : from + ((hi - v) / (hi - lo)) * (to - from)\n\nexport class Sparkline extends Component<SparklineSignature> {\n get nums() {\n return numbersOf(this.args.value)\n }\n\n get type(): SparklineType {\n return this.args.type ?? 'line'\n }\n\n get label() {\n return sparklineLabel(\n this.args.value,\n latticeLocale(getOwner(this), this.args.localeText, this.args.locale),\n )\n }\n\n get isLinear() {\n return this.type === 'line' || this.type === 'area'\n }\n\n get points(): Array<[number, number]> {\n const nums = this.nums\n const y = scale(Math.min(...nums), Math.max(...nums), PAD, H - PAD)\n const step = nums.length > 1 ? (W - 2 * PAD) / (nums.length - 1) : 0\n return nums.map((v, i) => [nums.length > 1 ? PAD + i * step : W / 2, y(v)])\n }\n\n /** One value has no line: it shows as a dot. */\n get dot() {\n const [x, y] = this.points[0] ?? [0, 0]\n return this.isLinear && this.nums.length === 1 ? { x, y } : undefined\n }\n\n get linePath() {\n if (!this.isLinear || this.nums.length < 2) return undefined\n return 'M' + this.points.map(([x, y]) => `${x},${y}`).join('L')\n }\n\n get areaPath() {\n const line = this.linePath\n if (this.type !== 'area' || !line) return undefined\n const xs = this.points.map(([x]) => x)\n return `${line}L${xs.at(-1)},${H}L${xs[0]},${H}Z`\n }\n\n /** Columns go up (or down) from the zero line; bars go right (or left) from it. */\n get rects(): Rect[] {\n if (this.isLinear) return []\n const nums = this.nums\n const lo = Math.min(0, ...nums)\n const hi = Math.max(0, ...nums)\n const columns = this.type === 'column'\n const band = (columns ? W : H) / nums.length\n // For bars the value runs along x, so the scale goes from right to left.\n const at = columns ? scale(lo, hi, PAD, H - PAD) : scale(lo, hi, W - PAD, PAD)\n const zero = at(0)\n return nums.map((v, i) => {\n const start = Math.min(at(v), zero)\n const length = Math.max(Math.abs(at(v) - zero), 0.5)\n const across = i * band + band * 0.1\n return columns\n ? { x: across, y: start, width: band * 0.8, height: length }\n : { x: start, y: across, width: length, height: band * 0.8 }\n })\n }\n\n <template>\n <svg\n class='lt-sparkline lt-sparkline-{{this.type}}'\n role='img'\n aria-label={{this.label}}\n viewBox='0 0 100 24'\n preserveAspectRatio='none'\n width='100%'\n height='20'\n style='display:block;color:var(--chart-1, currentColor)'\n ...attributes\n >\n {{#if this.areaPath}}\n <path\n class='lt-sparkline-area'\n d={{this.areaPath}}\n fill='currentColor'\n fill-opacity='0.2'\n stroke='none'\n />\n {{/if}}\n {{#if this.linePath}}\n <path\n class='lt-sparkline-line'\n d={{this.linePath}}\n fill='none'\n stroke='currentColor'\n stroke-width='1.5'\n vector-effect='non-scaling-stroke'\n />\n {{/if}}\n {{#if this.dot}}\n <circle cx={{this.dot.x}} cy={{this.dot.y}} r='2' fill='currentColor' />\n {{/if}}\n {{#each this.rects as |box|}}\n <rect\n x={{box.x}}\n y={{box.y}}\n width={{box.width}}\n height={{box.height}}\n fill='currentColor'\n />\n {{/each}}\n </svg>\n </template>\n}\n\n/** The cell signature: a full cell of `LatticeGrid` gets more arguments; it reads `value`. */\ninterface CellSignature {\n Args: { value: unknown }\n Element: SVGSVGElement\n}\n\nexport const LineSparkline: TOC<CellSignature> = <template>\n <Sparkline @value={{@value}} @type='line' ...attributes />\n</template>\n\nexport const AreaSparkline: TOC<CellSignature> = <template>\n <Sparkline @value={{@value}} @type='area' ...attributes />\n</template>\n\nexport const BarSparkline: TOC<CellSignature> = <template>\n <Sparkline @value={{@value}} @type='bar' ...attributes />\n</template>\n\nexport const ColumnSparkline: TOC<CellSignature> = <template>\n <Sparkline @value={{@value}} @type='column' ...attributes />\n</template>\n","// An integrated chart: the rows of a Lattice table, drawn by @ember-joinery/chart.\nimport Component from '@glimmer/component'\nimport { getOwner } from '@ember/owner'\nimport { guidFor } from '@ember/object/internals'\nimport { htmlSafe } from '@ember/template'\nimport is from '@sindresorhus/is'\nimport { latticeLocale } from '@ember-lattice/core'\nimport type { LatticeLocaleTextOverride } from '@ember-lattice/core'\nimport { ChartContainer } from '@ember-joinery/chart'\nimport type { ChartConfig } from '@ember-joinery/chart'\n\n/** The parts of a `@ember-lattice/core` table that the chart reads. */\nexport interface ChartColumn {\n id: string\n columnDef: { header?: unknown }\n}\n\nexport interface ChartRow {\n id: string\n getValue(columnId: string): unknown\n}\n\nexport interface ChartTable {\n getRowModel(): { rows: ReadonlyArray<ChartRow> }\n getAllLeafColumns(): ReadonlyArray<ChartColumn>\n getVisibleLeafColumns?(): ReadonlyArray<ChartColumn>\n}\n\nexport type LatticeChartType = 'line' | 'area' | 'bar'\n\nexport interface LatticeChartSignature {\n Args: {\n table: ChartTable\n /** The ids of the number columns: one series for each. */\n columns: ReadonlyArray<string>\n type: LatticeChartType\n /** The chart's name: the caption and the SVG title. */\n label: string\n /** The column of the x-axis labels. Default: the first visible column not in `columns`. */\n category?: string\n /** A selected range: only these rows, in table order. Default: all the current rows. */\n rowIds?: ReadonlyArray<string>\n /** Locale text that replaces the owner text for this chart. */\n localeText?: LatticeLocaleTextOverride\n /** The locale of the description and the numbers. Default: the owner locale. */\n locale?: string\n }\n Element: HTMLElement\n}\n\n/** The data key of the x-axis labels. A column id cannot start with `__lattice`. */\nconst CATEGORY = '__lattice_category'\n\n/** The data table is for screen readers only: it is not visible. */\nconst HIDDEN = htmlSafe(\n 'position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap',\n)\n\nexport default class LatticeChart extends Component<LatticeChartSignature> {\n CATEGORY = CATEGORY\n HIDDEN = HIDDEN\n captionId = `${guidFor(this)}-caption`\n\n get l() {\n return latticeLocale(getOwner(this), this.args.localeText, this.args.locale)\n }\n\n /** The header text of a column, or its id. */\n headerOf = (id: string) => {\n const header = this.args.table.getAllLeafColumns().find(c => c.id === id)?.columnDef.header\n return is.string(header) ? header : id\n }\n\n get seriesNames(): string[] {\n return this.args.columns.map(this.headerOf)\n }\n\n get categoryName(): string {\n const category = this.category\n return category ? this.headerOf(category) : this.l.t('charts.chart.category')\n }\n\n /** The SVG `<desc>`: the kind, the series, the category and the number of points. */\n get description(): string {\n const l = this.l\n return l.t('charts.chart.description', {\n type: l.t(`charts.chart.${this.args.type}`),\n series: new Intl.ListFormat(l.locale, { type: 'conjunction' }).format(this.seriesNames),\n category: this.categoryName,\n points: l.plural('charts.chart.points', this.data.length),\n })\n }\n\n /** The rows of the data table: the category, then a text for each series. */\n get tableRows(): { category: string; values: string[] }[] {\n const number = new Intl.NumberFormat(this.l.locale)\n return this.data.map(datum => ({\n category: String(datum[CATEGORY]),\n values: this.args.columns.map(id => {\n const value = datum[id]\n return is.number(value) ? number.format(value) : ''\n }),\n }))\n }\n\n get columns() {\n const table = this.args.table\n return table.getVisibleLeafColumns?.() ?? table.getAllLeafColumns()\n }\n\n get category() {\n return this.args.category ?? this.columns.find(c => !this.args.columns.includes(c.id))?.id\n }\n\n get config(): ChartConfig {\n const headers = new Map(this.args.table.getAllLeafColumns().map(c => [c.id, c.columnDef]))\n return Object.fromEntries(\n this.args.columns.map((id, i) => {\n const header = headers.get(id)?.header\n return [\n id,\n { label: is.string(header) ? header : id, color: `var(--chart-${(i % 5) + 1})` },\n ]\n }),\n )\n }\n\n get series() {\n return this.args.columns.map(key => ({ key, color: `var(--color-${key})` }))\n }\n\n get data() {\n const ids = this.args.rowIds ? new Set(this.args.rowIds) : undefined\n const category = this.category\n return this.args.table\n .getRowModel()\n .rows.filter(row => !ids || ids.has(row.id))\n .map(row => {\n const datum: Record<string, unknown> = {\n [CATEGORY]: category ? String(row.getValue(category) ?? '') : row.id,\n }\n for (const id of this.args.columns) {\n const value = row.getValue(id)\n datum[id] = is.number(value) ? value : null\n }\n return datum\n })\n }\n\n get isBar() {\n return this.args.type === 'bar'\n }\n\n get isArea() {\n return this.args.type === 'area'\n }\n\n <template>\n <figure class='lt-chart' aria-labelledby={{this.captionId}} ...attributes>\n <figcaption class='lt-chart-caption' id={{this.captionId}}>{{@label}}</figcaption>\n <ChartContainer @config={{this.config}} as |chart|>\n {{#if this.isBar}}\n <chart.BarChart @data={{this.data}} @title={{@label}} @desc={{this.description}} as |c|>\n <c.CartesianGrid @vertical={{false}} />\n <c.XAxis @dataKey={{this.CATEGORY}} />\n <c.YAxis />\n <c.ChartTooltip />\n {{#each this.series as |s|}}\n <c.Bar @dataKey={{s.key}} @fill={{s.color}} />\n {{/each}}\n </chart.BarChart>\n {{else if this.isArea}}\n <chart.AreaChart @data={{this.data}} @title={{@label}} @desc={{this.description}} as |c|>\n <c.CartesianGrid @vertical={{false}} />\n <c.XAxis @dataKey={{this.CATEGORY}} />\n <c.YAxis />\n <c.ChartTooltip />\n {{#each this.series as |s|}}\n <c.Area @dataKey={{s.key}} @fill={{s.color}} @stroke={{s.color}} />\n {{/each}}\n </chart.AreaChart>\n {{else}}\n <chart.LineChart @data={{this.data}} @title={{@label}} @desc={{this.description}} as |c|>\n <c.CartesianGrid @vertical={{false}} />\n <c.XAxis @dataKey={{this.CATEGORY}} />\n <c.YAxis />\n <c.ChartTooltip />\n {{#each this.series as |s|}}\n <c.Line @dataKey={{s.key}} @stroke={{s.color}} />\n {{/each}}\n </chart.LineChart>\n {{/if}}\n </ChartContainer>\n <table class='lt-chart-data' style={{this.HIDDEN}}>\n <caption>{{@label}}</caption>\n <thead>\n <tr>\n <th scope='col'>{{this.categoryName}}</th>\n {{#each this.seriesNames as |name|}}\n <th scope='col'>{{name}}</th>\n {{/each}}\n </tr>\n </thead>\n <tbody>\n {{#each this.tableRows as |row|}}\n <tr>\n <th scope='row'>{{row.category}}</th>\n {{#each row.values as |value|}}\n <td>{{value}}</td>\n {{/each}}\n </tr>\n {{/each}}\n </tbody>\n </table>\n </figure>\n </template>\n}\n","// Chart a range: a chart of the selected cells of a grid. The rows of the range are the points.\n// The number columns of the range are the series, and the first other column is the x-axis.\n// An app opens it from a context menu item (the `export` block of `GridContextMenu`).\nimport Component from '@glimmer/component'\nimport is from '@sindresorhus/is'\nimport type { GridRange } from '@ember-lattice/ember'\nimport LatticeChart from './lattice-chart.gts'\nimport type { ChartColumn, ChartTable, LatticeChartType } from './lattice-chart.gts'\n\n/** A table with the parts that a range needs: the cell selection and the pinned column order. */\nexport interface ChartRangeTable extends ChartTable {\n getCellSelectionBounds?(): ReadonlyArray<GridRange>\n getStartVisibleLeafColumns?(): ReadonlyArray<ChartColumn>\n getCenterVisibleLeafColumns?(): ReadonlyArray<ChartColumn>\n getEndVisibleLeafColumns?(): ReadonlyArray<ChartColumn>\n}\n\nexport interface RangeChartArgs {\n rowIds: string[]\n columns: string[]\n category: string | undefined\n}\n\n/** The columns in the order of the grid: start pinned, center, end pinned. */\nfunction displayColumns(table: ChartRangeTable): ReadonlyArray<ChartColumn> {\n const center =\n table.getCenterVisibleLeafColumns?.() ??\n table.getVisibleLeafColumns?.() ??\n table.getAllLeafColumns()\n return [\n ...(table.getStartVisibleLeafColumns?.() ?? []),\n ...center,\n ...(table.getEndVisibleLeafColumns?.() ?? []),\n ]\n}\n\n/** The `LatticeChart` args of a range: its row IDs, its number columns and its category. */\nexport function rangeChartArgs(table: ChartRangeTable, range: GridRange): RangeChartArgs {\n const rows = table.getRowModel().rows.slice(range.minRowIndex, range.maxRowIndex + 1)\n const ids = displayColumns(table)\n .slice(range.minColumnIndex, range.maxColumnIndex + 1)\n .map(c => c.id)\n // A column is a series when its values in the range are numbers (blanks are allowed).\n const isNumber = (id: string) =>\n rows.some(r => is.number(r.getValue(id))) &&\n rows.every(r => is.number(r.getValue(id)) || is.nullOrUndefined(r.getValue(id)))\n return {\n rowIds: rows.map(r => r.id),\n columns: ids.filter(isNumber),\n category: ids.find(id => !isNumber(id)),\n }\n}\n\nexport interface RangeChartSignature {\n Args: {\n table: ChartRangeTable\n type: LatticeChartType\n label: string\n /** The range. Default: the last range of the table cell selection. */\n range?: GridRange\n }\n Element: HTMLElement\n}\n\nexport class RangeChart extends Component<RangeChartSignature> {\n get range(): GridRange | undefined {\n return this.args.range ?? this.args.table.getCellSelectionBounds?.().at(-1)\n }\n\n get chart(): RangeChartArgs | undefined {\n const range = this.range\n return range ? rangeChartArgs(this.args.table, range) : undefined\n }\n\n <template>\n {{#if this.chart}}\n <LatticeChart\n @table={{@table}}\n @columns={{this.chart.columns}}\n @rowIds={{this.chart.rowIds}}\n @category={{this.chart.category}}\n @type={{@type}}\n @label={{@label}}\n ...attributes\n />\n {{/if}}\n </template>\n}\n"],"names":["W","H","PAD","numbersOf","value","is","array","filter","v","number","Number","isFinite","sparklineLabel","l","latticeLocale","undefined","nums","length","t","Intl","NumberFormat","locale","maximumFractionDigits","min","max","last","Math","at","map","n","format","scale","lo","hi","from","to","Sparkline","Component","args","type","label","getOwner","localeText","isLinear","points","y","step","i","dot","x","linePath","join","areaPath","line","xs","rects","columns","band","zero","start","abs","across","width","height","setComponentTemplate","precompileTemplate","strictMode","LineSparkline","scope","templateOnly","AreaSparkline","BarSparkline","ColumnSparkline","CATEGORY","HIDDEN","htmlSafe","LatticeChart","captionId","guidFor","headerOf","id","header","table","getAllLeafColumns","find","c","columnDef","string","seriesNames","categoryName","category","description","series","ListFormat","plural","data","tableRows","datum","String","values","getVisibleLeafColumns","includes","config","headers","Map","Object","fromEntries","get","color","key","ids","rowIds","Set","getRowModel","rows","row","has","getValue","isBar","isArea","ChartContainer","displayColumns","center","getCenterVisibleLeafColumns","getStartVisibleLeafColumns","getEndVisibleLeafColumns","rangeChartArgs","range","slice","minRowIndex","maxRowIndex","minColumnIndex","maxColumnIndex","isNumber","some","r","every","nullOrUndefined","RangeChart","getCellSelectionBounds","chart"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AAuBA,MAAMA,CAAA,GAAI,GAAA;AACV,MAAMC,CAAA,GAAI,EAAA;AACV,MAAMC,GAAA,GAAM,CAAA;AAEZ,MAAMC,SAAA,GAAaC,KAAc,IAC/BC,EAAA,CAAGC,KAAK,CAACF,KAAA,CAAA,GAASA,KAAA,CAAMG,MAAM,CAAEC,CAAA,IAAmBH,EAAA,CAAGI,MAAM,CAACD,CAAA,CAAA,IAAME,MAAA,CAAOC,QAAQ,CAACH,CAAA,CAAA,CAAA,GAAM,EAAE;AAE7F;;;;AAIO,SAASI,cAAAA,CACdR,KAAc,EACdS,CAAG,GAAgBC,aAAA,CAAcC,SAAA,CAAU,EACpC;AACP,EAAA,MAAMC,OAAOb,SAAA,CAAUC,KAAA,CAAA;AACvB,EAAA,IAAIY,KAAKC,MAAM,KAAK,GAAG,OAAOJ,CAAA,CAAEK,CAAC,CAAC,yBAAA,CAAA;EAClC,MAAMT,SAAS,IAAIU,IAAA,CAAKC,YAAY,CAACP,CAAA,CAAEQ,MAAM,EAAE;AAAEC,IAAAA,qBAAA,EAAuB;AAAE,GAAA,CAAA;EAC1E,MAAM,CAACC,GAAA,EAAKC,GAAA,EAAKC,IAAA,CAAK,GAAG,CAACC,IAAA,CAAKH,GAAG,CAAA,GAAIP,IAAA,CAAA,EAAOU,IAAA,CAAKF,GAAG,CAAA,GAAIR,IAAA,CAAA,EAAOA,IAAA,CAAKW,EAAE,CAAC,EAAC,CAAA,CAAI,CAACC,GAAG,CAACC,CAAA,IAChFpB,MAAA,CAAOqB,MAAM,CAACD,CAAA,CAAA,CA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AQ,CAACrC,QAAQ3E,EAAA,CAAGoI,eAAe,CAACF,CAAA,CAAElB,QAAQ,CAACrC,EAAA,CAAA,CAAA,CAAA;EAC7E,OAAO;IACL+B,MAAA,EAAQG,KAAKtF,GAAG,CAAC2G,CAAA,IAAKA,EAAEvD,EAAE,CAAA;AAC1BxB,IAAAA,OAAA,EAASsD,GAAA,CAAIvG,MAAM,CAAC8H,QAAA,CAAA;IACpB3C,QAAA,EAAUoB,IAAI1B,IAAI,CAACJ,EAAA,IAAM,CAACqD,QAAA,CAASrD,EAAA,CAAA;GACrC;AACF;AAaO,MAAM0D,mBAAmBrG,SAAA,CAAU;EACxC,IAAI0F,KAAAA,GAA+B;IACjC,OAAO,IAAI,CAACzF,IAAI,CAACyF,KAAK,IAAI,IAAI,CAACzF,IAAI,CAAC4C,KAAK,CAACyD,sBAAsB,IAAA,CAAKhH,GAAG,EAAC,CAAA;AAC3E,EAAA;EAEA,IAAIiH,KAAAA,GAAoC;AACtC,IAAA,MAAMb,KAAA,GAAQ,IAAI,CAACA,KAAK;AACxB,IAAA,OAAOA,KAAA,GAAQD,eAAe,IAAI,CAACxF,IAAI,CAAC4C,KAAK,EAAE6C,KAAA,CAAA,GAAShH,SAAA;AAC1D,EAAA;AAEA,EAAA;IAAAiD,oBAAA,CAAAC,kBAAA,CAAA,mNAAA,EAYA;MAAAC,UAAA,EAAA,IAAA;AAAAE,MAAAA,KAAA,EAAAA,OAAA;AAAAQ,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,92 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-lattice/charts",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Sparklines and integrated charts for Lattice, through the Joinery chart add-on.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ember-addon",
|
|
7
|
+
"ember",
|
|
8
|
+
"data-grid",
|
|
9
|
+
"table",
|
|
10
|
+
"virtual-scroll"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Joe Gaudet <joe@joegaudet.com>",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/joegaudet/ember-lattice.git",
|
|
17
|
+
"directory": "packages/charts"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://joegaudet.com/ember-lattice/",
|
|
20
|
+
"bugs": "https://github.com/joegaudet/ember-lattice/issues",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./declarations/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./addon-main.js": "./addon-main.cjs"
|
|
27
|
+
},
|
|
28
|
+
"typesVersions": {
|
|
29
|
+
"*": {
|
|
30
|
+
"*": [
|
|
31
|
+
"declarations/*"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"addon-main.cjs",
|
|
37
|
+
"declarations",
|
|
38
|
+
"dist",
|
|
39
|
+
"README.md",
|
|
40
|
+
"CHANGELOG.md",
|
|
41
|
+
"LICENSE.md",
|
|
42
|
+
"NOTICE"
|
|
43
|
+
],
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@ember-lattice/core": "1.0.0",
|
|
46
|
+
"@ember-lattice/ember": "1.0.0",
|
|
47
|
+
"@embroider/addon-shim": "^1.10.3",
|
|
48
|
+
"@sindresorhus/is": "^7.2.0",
|
|
49
|
+
"decorator-transforms": "^2.4.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"@glimmer/component": ">= 2.0.0",
|
|
53
|
+
"ember-source": ">= 6.12.0",
|
|
54
|
+
"@ember-joinery/chart": "^1.0.1"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@babel/core": "^7.29.7",
|
|
58
|
+
"@babel/plugin-transform-typescript": "^7.29.7",
|
|
59
|
+
"@babel/runtime": "^7.29.7",
|
|
60
|
+
"@ember-joinery/chart": "^1.0.1",
|
|
61
|
+
"@ember/library-tsconfig": "^3.0.0",
|
|
62
|
+
"@embroider/addon-dev": "^8.4.2",
|
|
63
|
+
"@glimmer/component": "^2.2.1",
|
|
64
|
+
"@glimmer/tracking": "^1.1.2",
|
|
65
|
+
"@glint/ember-tsc": "^1.14.2",
|
|
66
|
+
"@glint/template": "^1.9.0",
|
|
67
|
+
"@rollup/plugin-babel": "^7.1.0",
|
|
68
|
+
"babel-plugin-ember-template-compilation": "^4.0.1",
|
|
69
|
+
"ember-source": "~7.3.0",
|
|
70
|
+
"rollup": "^4.64.6",
|
|
71
|
+
"typescript": "~6.0.3"
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"access": "public"
|
|
75
|
+
},
|
|
76
|
+
"engines": {
|
|
77
|
+
"node": ">=22.12.0"
|
|
78
|
+
},
|
|
79
|
+
"ember": {
|
|
80
|
+
"edition": "octane"
|
|
81
|
+
},
|
|
82
|
+
"ember-addon": {
|
|
83
|
+
"version": 2,
|
|
84
|
+
"type": "addon",
|
|
85
|
+
"main": "addon-main.cjs"
|
|
86
|
+
},
|
|
87
|
+
"scripts": {
|
|
88
|
+
"build": "rm -rf declarations && rollup --config",
|
|
89
|
+
"start": "rm -rf declarations && rollup --config --watch",
|
|
90
|
+
"typecheck": "ember-tsc --noEmit"
|
|
91
|
+
}
|
|
6
92
|
}
|