@orchidsoftware/charts 0.0.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/CHANGELOG.md +71 -0
- package/LICENSE +21 -0
- package/README.md +122 -0
- package/dist/core/Chart.js +1 -0
- package/dist/core/Chart.js.map +1 -0
- package/dist/core/ChartData.js +1 -0
- package/dist/core/ChartData.js.map +1 -0
- package/dist/core/ChartDefinition.js +1 -0
- package/dist/core/ChartDefinition.js.map +1 -0
- package/dist/core/ChartSelection.js +1 -0
- package/dist/core/ChartSelection.js.map +1 -0
- package/dist/core/ChartTooltip.js +1 -0
- package/dist/core/ChartTooltip.js.map +1 -0
- package/dist/core/InteractionController.js +1 -0
- package/dist/core/InteractionController.js.map +1 -0
- package/dist/core/NormalizeAnnotations.js +1 -0
- package/dist/core/NormalizeAnnotations.js.map +1 -0
- package/dist/core/Options.js +1 -0
- package/dist/core/Options.js.map +1 -0
- package/dist/core/builders/Builder.js +1 -0
- package/dist/core/builders/Builder.js.map +1 -0
- package/dist/core/builders/BuilderArguments.js +1 -0
- package/dist/core/builders/BuilderArguments.js.map +1 -0
- package/dist/core/builders/BuilderScopes.js +1 -0
- package/dist/core/builders/BuilderScopes.js.map +1 -0
- package/dist/core/builders/BuilderState.js +1 -0
- package/dist/core/builders/BuilderState.js.map +1 -0
- package/dist/core/builders/BuilderValidation.js +1 -0
- package/dist/core/builders/BuilderValidation.js.map +1 -0
- package/dist/core/builders/CartesianBuilders.js +1 -0
- package/dist/core/builders/CartesianBuilders.js.map +1 -0
- package/dist/core/builders/CompositionBuilders.js +1 -0
- package/dist/core/builders/CompositionBuilders.js.map +1 -0
- package/dist/core/builders/TemporalBuilders.js +1 -0
- package/dist/core/builders/TemporalBuilders.js.map +1 -0
- package/dist/index.js +1 -0
- package/dist/renderers/ChartRendering.js +1 -0
- package/dist/renderers/ChartRendering.js.map +1 -0
- package/dist/renderers/LegendRenderer.js +1 -0
- package/dist/renderers/LegendRenderer.js.map +1 -0
- package/dist/renderers/SvgSurface.js +1 -0
- package/dist/renderers/SvgSurface.js.map +1 -0
- package/dist/renderers/cartesian/CartesianAxesRenderer.js +1 -0
- package/dist/renderers/cartesian/CartesianAxesRenderer.js.map +1 -0
- package/dist/renderers/cartesian/CartesianInspectorRenderer.js +1 -0
- package/dist/renderers/cartesian/CartesianInspectorRenderer.js.map +1 -0
- package/dist/renderers/cartesian/CartesianLayout.js +1 -0
- package/dist/renderers/cartesian/CartesianLayout.js.map +1 -0
- package/dist/renderers/cartesian/CartesianRendering.js +1 -0
- package/dist/renderers/cartesian/CartesianRendering.js.map +1 -0
- package/dist/renderers/cartesian/CartesianSeriesRendering.js +1 -0
- package/dist/renderers/cartesian/CartesianSeriesRendering.js.map +1 -0
- package/dist/renderers/composition/AggregationRendering.js +1 -0
- package/dist/renderers/composition/AggregationRendering.js.map +1 -0
- package/dist/renderers/composition/Composition.js +1 -0
- package/dist/renderers/composition/Composition.js.map +1 -0
- package/dist/renderers/composition/PolarAreaRendering.js +1 -0
- package/dist/renderers/composition/PolarAreaRendering.js.map +1 -0
- package/dist/renderers/composition/RadarRendering.js +1 -0
- package/dist/renderers/composition/RadarRendering.js.map +1 -0
- package/dist/renderers/temporal/HeatmapRendering.js +1 -0
- package/dist/renderers/temporal/HeatmapRendering.js.map +1 -0
- package/dist/renderers/temporal/TimesheetLayout.js +1 -0
- package/dist/renderers/temporal/TimesheetLayout.js.map +1 -0
- package/dist/renderers/temporal/TimesheetRendering.js +1 -0
- package/dist/renderers/temporal/TimesheetRendering.js.map +1 -0
- package/dist/support/Constants.js +1 -0
- package/dist/support/Constants.js.map +1 -0
- package/dist/support/Dom.js +1 -0
- package/dist/support/Dom.js.map +1 -0
- package/dist/support/Normalize.js +2 -0
- package/dist/support/Normalize.js.map +1 -0
- package/dist/support/Validation.js +1 -0
- package/dist/support/Validation.js.map +1 -0
- package/dist/support/geometry/CartesianGeometry.js +1 -0
- package/dist/support/geometry/CartesianGeometry.js.map +1 -0
- package/dist/support/geometry/Scale.js +1 -0
- package/dist/support/geometry/Scale.js.map +1 -0
- package/dist/support/geometry/SectorGeometry.js +1 -0
- package/dist/support/geometry/SectorGeometry.js.map +1 -0
- package/dist/support/presentation/Formatting.js +1 -0
- package/dist/support/presentation/Formatting.js.map +1 -0
- package/dist/support/presentation/Presentation.js +1 -0
- package/dist/support/presentation/Presentation.js.map +1 -0
- package/dist/support/presentation/Time.js +1 -0
- package/dist/support/presentation/Time.js.map +1 -0
- package/docs/api-reference.md +322 -0
- package/docs/bar.md +110 -0
- package/docs/bubble.md +76 -0
- package/docs/chart-types.md +35 -0
- package/docs/customization.md +178 -0
- package/docs/donut.md +55 -0
- package/docs/exporting.md +87 -0
- package/docs/frameworks.md +203 -0
- package/docs/getting-started.md +121 -0
- package/docs/heatmap.md +95 -0
- package/docs/line.md +148 -0
- package/docs/mixed.md +114 -0
- package/docs/percentage.md +48 -0
- package/docs/pie.md +58 -0
- package/docs/polar-area.md +46 -0
- package/docs/radar.md +49 -0
- package/docs/readme.md +37 -0
- package/docs/scatter.md +83 -0
- package/docs/timesheet.md +125 -0
- package/docs/updates-and-interaction.md +124 -0
- package/package.json +133 -0
- package/src/index.d.ts +481 -0
- package/src/styles.css +350 -0
package/docs/readme.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Charts2 documentation
|
|
2
|
+
|
|
3
|
+
Charts2 helps you turn product data into responsive SVG charts with a small,
|
|
4
|
+
consistent JavaScript API. It is part of [Orchid Software](https://orchid.software).
|
|
5
|
+
|
|
6
|
+
If this is your first chart, begin with [Getting started](./getting-started.md).
|
|
7
|
+
You will install the package and render a useful line chart in a few minutes.
|
|
8
|
+
|
|
9
|
+
## Learn by result
|
|
10
|
+
|
|
11
|
+
- [Getting started](./getting-started.md) — render a chart, add another series,
|
|
12
|
+
and understand the three-step API.
|
|
13
|
+
- [Customization](./customization.md) — change colors, size, layout, labels,
|
|
14
|
+
tooltips, and annotations.
|
|
15
|
+
- [Updates and interaction](./updates-and-interaction.md) — update data, react
|
|
16
|
+
to selections, inspect points, and clean up.
|
|
17
|
+
- [Exporting SVG](./exporting.md) — serialize or download the current chart.
|
|
18
|
+
- [React, Vue, and Hotwire](./frameworks.md) — mount, update, and destroy charts with component lifecycles.
|
|
19
|
+
- [API reference](./api-reference.md) — look up chart definitions and public methods.
|
|
20
|
+
|
|
21
|
+
## Chart types
|
|
22
|
+
|
|
23
|
+
- [Line](./line.md)
|
|
24
|
+
- [Bar](./bar.md)
|
|
25
|
+
- [Scatter](./scatter.md)
|
|
26
|
+
- [Mixed](./mixed.md)
|
|
27
|
+
- [Bubble](./bubble.md)
|
|
28
|
+
- [Pie](./pie.md)
|
|
29
|
+
- [Donut](./donut.md)
|
|
30
|
+
- [Percentage](./percentage.md)
|
|
31
|
+
- [Radar](./radar.md)
|
|
32
|
+
- [Polar area](./polar-area.md)
|
|
33
|
+
- [Calendar heatmap](./heatmap.md)
|
|
34
|
+
- [Timesheet](./timesheet.md)
|
|
35
|
+
|
|
36
|
+
Choose a chart, point it at an element, add data, and render. Everything between
|
|
37
|
+
the data and `render()` is optional.
|
package/docs/scatter.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Scatter charts
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
Scatter charts show whether two measurements move together. Each point has an
|
|
6
|
+
`x` and `y` coordinate; multiple named datasets may be compared in one chart.
|
|
7
|
+
|
|
8
|
+
## Creating a scatter chart
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
import { ScatterChart } from "@orchidsoftware/charts";
|
|
12
|
+
import "@orchidsoftware/charts/style.css";
|
|
13
|
+
|
|
14
|
+
const chart = ScatterChart.make("#results")
|
|
15
|
+
.dataset("Teams", [
|
|
16
|
+
{ x: 12, y: 38 },
|
|
17
|
+
{ x: 18, y: 51 },
|
|
18
|
+
{ x: 25, y: 63 },
|
|
19
|
+
])
|
|
20
|
+
.render();
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The value returned by `render()` is the mounted chart and may be updated,
|
|
24
|
+
selected, or exported.
|
|
25
|
+
|
|
26
|
+
## Point data
|
|
27
|
+
|
|
28
|
+
The clearest scatter input uses `{ x, y }` objects:
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
import { ScatterChart } from "@orchidsoftware/charts";
|
|
32
|
+
|
|
33
|
+
ScatterChart.make("#results")
|
|
34
|
+
.dataset("Current", [
|
|
35
|
+
{ x: 4, y: 18 },
|
|
36
|
+
{ x: 8, y: 31 },
|
|
37
|
+
{ x: 12, y: 46 },
|
|
38
|
+
])
|
|
39
|
+
.dataset("Previous", [
|
|
40
|
+
{ x: 4, y: 15 },
|
|
41
|
+
{ x: 8, y: 25 },
|
|
42
|
+
{ x: 12, y: 38 },
|
|
43
|
+
])
|
|
44
|
+
.render();
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
A plain number is also accepted. In that form, its array index becomes the
|
|
48
|
+
`x` coordinate:
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
import { ScatterChart } from "@orchidsoftware/charts";
|
|
52
|
+
|
|
53
|
+
ScatterChart.make("#results").dataset([18, 31, 46]).render();
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Point visibility
|
|
57
|
+
|
|
58
|
+
Use `dots(false)` to hide scatter marks while keeping the chart's scale and
|
|
59
|
+
annotations:
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
import { ScatterChart } from "@orchidsoftware/charts";
|
|
63
|
+
|
|
64
|
+
ScatterChart.make("#results").dataset(points).dots(false).render();
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Dataset appearance
|
|
68
|
+
|
|
69
|
+
A scatter dataset callback supports `color()`, `opacity()`, and
|
|
70
|
+
`formatValue()`:
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
import { ScatterChart } from "@orchidsoftware/charts";
|
|
74
|
+
|
|
75
|
+
ScatterChart.make("#results")
|
|
76
|
+
.dataset("Teams", points, (dataset) => {
|
|
77
|
+
dataset.color("#2563eb").opacity(0.75);
|
|
78
|
+
})
|
|
79
|
+
.render();
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Scatter charts also support the shared [cartesian presentation, formatting,
|
|
83
|
+
and annotation methods](./customization.md).
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Timesheet charts
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
Timesheet charts place tasks across a time axis. They are suitable for release
|
|
6
|
+
plans, phases, bookings, schedules, and other product views where both start
|
|
7
|
+
and end dates matter.
|
|
8
|
+
|
|
9
|
+
## Creating a timesheet chart
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { TimesheetChart } from "@orchidsoftware/charts";
|
|
13
|
+
import "@orchidsoftware/charts/style.css";
|
|
14
|
+
|
|
15
|
+
const chart = TimesheetChart.make("#release-plan")
|
|
16
|
+
.task("Design", "2026-09-01", "2026-09-03")
|
|
17
|
+
.task("Build", "2026-09-03", "2026-09-08")
|
|
18
|
+
.render();
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Dates may be `Date` objects, millisecond timestamps, `YYYY-MM-DD` strings, or
|
|
22
|
+
date-time strings with an explicit timezone.
|
|
23
|
+
|
|
24
|
+
## Task details
|
|
25
|
+
|
|
26
|
+
Pass an object when a task needs a group or color:
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { TimesheetChart } from "@orchidsoftware/charts";
|
|
30
|
+
|
|
31
|
+
TimesheetChart.make("#release-plan")
|
|
32
|
+
.task({
|
|
33
|
+
label: "Design",
|
|
34
|
+
start: "2026-09-01",
|
|
35
|
+
end: "2026-09-03",
|
|
36
|
+
group: "Product",
|
|
37
|
+
color: "#8b5cf6",
|
|
38
|
+
})
|
|
39
|
+
.task({
|
|
40
|
+
label: "Build",
|
|
41
|
+
start: "2026-09-03",
|
|
42
|
+
end: "2026-09-08",
|
|
43
|
+
group: "Engineering",
|
|
44
|
+
color: "#2563eb",
|
|
45
|
+
})
|
|
46
|
+
.render();
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Displaying a fixed range
|
|
50
|
+
|
|
51
|
+
Without `range()`, Charts2 derives the timeline from the earliest start and
|
|
52
|
+
latest end. Use `range()` when the view should include additional time:
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
import { TimesheetChart } from "@orchidsoftware/charts";
|
|
56
|
+
|
|
57
|
+
TimesheetChart.make("#release-plan")
|
|
58
|
+
.range("2026-09-01", "2026-09-12")
|
|
59
|
+
.task("Design", "2026-09-01", "2026-09-03")
|
|
60
|
+
.task("Build", "2026-09-03", "2026-09-08")
|
|
61
|
+
.render();
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Axes, grid, and labels
|
|
65
|
+
|
|
66
|
+
Use `axes(false)`, `grid(false)`, and `valueLabels(false)` to remove individual
|
|
67
|
+
presentation layers:
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
import { TimesheetChart } from "@orchidsoftware/charts";
|
|
71
|
+
|
|
72
|
+
TimesheetChart.make("#release-plan")
|
|
73
|
+
.task("Design", "2026-09-01", "2026-09-03")
|
|
74
|
+
.axes(false)
|
|
75
|
+
.grid(false)
|
|
76
|
+
.valueLabels(false)
|
|
77
|
+
.render();
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Date and duration formatting
|
|
81
|
+
|
|
82
|
+
`formatDate()` formats dates in chart content, `formatDuration()` formats task
|
|
83
|
+
durations, and `formatTick()` formats the time axis:
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
import { TimesheetChart } from "@orchidsoftware/charts";
|
|
87
|
+
|
|
88
|
+
TimesheetChart.make("#release-plan")
|
|
89
|
+
.task("Design", "2026-09-01", "2026-09-03")
|
|
90
|
+
.formatDate((date) => date.toLocaleDateString())
|
|
91
|
+
.formatDuration((milliseconds) => `${milliseconds / 86_400_000} days`)
|
|
92
|
+
.formatTick((date) => date.toLocaleDateString(undefined, { month: "short", day: "numeric" }))
|
|
93
|
+
.render();
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Rounded task bars
|
|
97
|
+
|
|
98
|
+
The `radius()` method rounds task bars in CSS pixels:
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
import { TimesheetChart } from "@orchidsoftware/charts";
|
|
102
|
+
|
|
103
|
+
TimesheetChart.make("#release-plan").task("Design", "2026-09-01", "2026-09-03").radius(5).render();
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Formatting the tooltip
|
|
107
|
+
|
|
108
|
+
The timesheet tooltip provides its own date and duration formatters:
|
|
109
|
+
|
|
110
|
+
```js
|
|
111
|
+
import { TimesheetChart } from "@orchidsoftware/charts";
|
|
112
|
+
|
|
113
|
+
TimesheetChart.make("#release-plan")
|
|
114
|
+
.task("Design", "2026-09-01", "2026-09-03")
|
|
115
|
+
.tooltip((tooltip) => {
|
|
116
|
+
tooltip
|
|
117
|
+
.formatDate((date) => date.toLocaleDateString())
|
|
118
|
+
.formatDuration((milliseconds) => `${milliseconds / 86_400_000} days`);
|
|
119
|
+
})
|
|
120
|
+
.render();
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Timesheet charts also support the shared `title()`, `description()`,
|
|
124
|
+
`ariaLabel()`, `width()`, `height()`, `colors()`, `tooltip()`, and `onSelect()`
|
|
125
|
+
methods. See [Customization](./customization.md) for details.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Updates and interaction
|
|
2
|
+
|
|
3
|
+
`render()` returns the mounted chart. Keep that value when data can change or
|
|
4
|
+
when your interface needs to react to the chart.
|
|
5
|
+
|
|
6
|
+
```js
|
|
7
|
+
import { LineChart } from "@orchidsoftware/charts";
|
|
8
|
+
import "@orchidsoftware/charts/style.css";
|
|
9
|
+
|
|
10
|
+
const chart = LineChart.make("#revenue")
|
|
11
|
+
.labels(["Jan", "Feb", "Mar"])
|
|
12
|
+
.dataset("Revenue", [42, 48, 57])
|
|
13
|
+
.render();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Replace the data
|
|
17
|
+
|
|
18
|
+
`update(data)` replaces the complete data scene and redraws the existing chart.
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
chart.update({
|
|
22
|
+
labels: ["Feb", "Mar", "Apr"],
|
|
23
|
+
datasets: [{ name: "Revenue", values: [48, 57, 63] }],
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Send all datasets that should remain visible. The update is validated before
|
|
28
|
+
the current chart changes, so invalid data does not leave a half-updated view.
|
|
29
|
+
|
|
30
|
+
Series charts use this shape:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
chart.update({
|
|
34
|
+
labels: ["Jan", "Feb", "Mar"],
|
|
35
|
+
datasets: [
|
|
36
|
+
{ name: "Actual", values: [42, 48, 57], color: "#2563eb" },
|
|
37
|
+
{ name: "Plan", values: [45, 50, 55], color: "#94a3b8" },
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Heatmaps and timesheets use their own domain data:
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
activity.update({
|
|
46
|
+
points: {
|
|
47
|
+
"2026-08-27": 7,
|
|
48
|
+
"2026-08-28": 4,
|
|
49
|
+
"2026-08-29": 9,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
plan.update({
|
|
54
|
+
tasks: [
|
|
55
|
+
{ label: "Design", start: "2026-09-01", end: "2026-09-03" },
|
|
56
|
+
{ label: "Build", start: "2026-09-03", end: "2026-09-08" },
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## React to a selection
|
|
62
|
+
|
|
63
|
+
Use `onSelect()` to connect a mark to the rest of your interface.
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
import { BarChart } from "@orchidsoftware/charts";
|
|
67
|
+
|
|
68
|
+
BarChart.make("#orders")
|
|
69
|
+
.labels(["Web", "Retail", "Partners"])
|
|
70
|
+
.dataset("Orders", [124, 86, 43])
|
|
71
|
+
.onSelect((selection) => {
|
|
72
|
+
if (!selection) {
|
|
73
|
+
closeDetails();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
openDetails({
|
|
78
|
+
channel: selection.label,
|
|
79
|
+
orders: selection.value,
|
|
80
|
+
});
|
|
81
|
+
})
|
|
82
|
+
.render();
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The callback receives the selected label, value, dataset, and coordinates for
|
|
86
|
+
series charts. Composition charts add the selected color; heatmaps add a date
|
|
87
|
+
and key; timesheets add the task range and duration. It receives `undefined`
|
|
88
|
+
when the selection is cleared.
|
|
89
|
+
|
|
90
|
+
Pointer, touch, and keyboard input share the same selection model. Arrow keys
|
|
91
|
+
move between values, Enter or Space keeps a selection open, and Escape clears
|
|
92
|
+
it.
|
|
93
|
+
|
|
94
|
+
## Read a normalized point
|
|
95
|
+
|
|
96
|
+
`point(index)` returns an immutable snapshot without exposing internal SVG
|
|
97
|
+
nodes. Without an index it returns the active keyboard or pointer point, or the
|
|
98
|
+
first point when nothing is active.
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
const first = chart.point();
|
|
102
|
+
const third = chart.point(2);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
It returns `undefined` when the index is outside the chart data.
|
|
106
|
+
|
|
107
|
+
## Export the chart
|
|
108
|
+
|
|
109
|
+
Every mounted chart can return its current SVG source or download an SVG file.
|
|
110
|
+
See [Exporting SVG](./exporting.md) for both workflows.
|
|
111
|
+
|
|
112
|
+
## Clean up
|
|
113
|
+
|
|
114
|
+
Destroy a chart when its view is permanently removed:
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
chart.destroy();
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
This removes the owned SVG, tooltip, observers, and event listeners. Calling
|
|
121
|
+
`destroy()` again is safe. A destroyed chart cannot be updated or exported.
|
|
122
|
+
|
|
123
|
+
For method signatures and chart-specific data shapes, use the
|
|
124
|
+
[API reference](./api-reference.md).
|
package/package.json
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@orchidsoftware/charts",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Clear, responsive SVG charts for product interfaces with one small JavaScript API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"packageManager": "npm@11.16.0",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"**/*.css"
|
|
9
|
+
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./src/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./style.css": "./src/styles.css",
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"types": "./src/index.d.ts",
|
|
22
|
+
"style": "./src/styles.css",
|
|
23
|
+
"homepage": "https://charts.orchid.software",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/orchidsoftware/charts.git"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/orchidsoftware/charts/issues"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"docs",
|
|
37
|
+
"src/index.d.ts",
|
|
38
|
+
"src/styles.css",
|
|
39
|
+
"CHANGELOG.md",
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE",
|
|
42
|
+
"NOTICE"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"dev": "vite --open /demo/",
|
|
46
|
+
"build": "vite build && node scripts/WriteBuildSize.mjs",
|
|
47
|
+
"build:demo": "vite build --config ViteDemoConfig.js",
|
|
48
|
+
"preview": "vite preview",
|
|
49
|
+
"format": "prettier --write \"**/*.{js,mjs,cjs,ts,css,html,md,json,yml,yaml}\" --ignore-unknown",
|
|
50
|
+
"format:check": "prettier --check \"**/*.{js,mjs,cjs,ts,css,html,md,json,yml,yaml}\" --ignore-unknown",
|
|
51
|
+
"lint": "npm run lint:js && npm run lint:css",
|
|
52
|
+
"lint:fix": "npm run lint:js:fix && npm run lint:css:fix",
|
|
53
|
+
"lint:js": "eslint . --max-warnings 0",
|
|
54
|
+
"lint:js:fix": "eslint . --fix --max-warnings 0",
|
|
55
|
+
"lint:css": "stylelint \"{src,demo}/**/*.css\" --max-warnings 0",
|
|
56
|
+
"lint:css:fix": "stylelint \"{src,demo}/**/*.css\" --fix --max-warnings 0",
|
|
57
|
+
"typecheck": "tsc -p tsconfig.types.json --module ESNext --moduleResolution Bundler && tsc -p tsconfig.types.json --module Node16 --moduleResolution Node16 && tsc -p tsconfig.types.json",
|
|
58
|
+
"test": "vitest run",
|
|
59
|
+
"test:size": "npm run build",
|
|
60
|
+
"test:lab": "vitest run test/Lab.test.js",
|
|
61
|
+
"test:watch": "vitest",
|
|
62
|
+
"test:visual": "vitest run test/VisualRegression.test.js",
|
|
63
|
+
"test:visual:update": "vitest run test/VisualRegression.test.js --update",
|
|
64
|
+
"test:performance": "vitest run test/Performance.test.js",
|
|
65
|
+
"test:compatibility": "CHARTS2_COMPATIBILITY=1 vitest run test/Compatibility.test.js",
|
|
66
|
+
"test:no-build": "vite build && node scripts/TestNoBuild.mjs",
|
|
67
|
+
"test:ssr": "vite build && node --input-type=module --eval \"await import('./dist/index.js')\"",
|
|
68
|
+
"coverage": "vitest run --coverage --exclude test/Performance.test.js",
|
|
69
|
+
"audit": "npm audit --audit-level=high",
|
|
70
|
+
"pack:check": "npm pack --dry-run --ignore-scripts",
|
|
71
|
+
"check": "npm run format:check && npm run lint && npm run typecheck && npm run coverage && npm run test:performance && npm run test:compatibility && npm run test:no-build && npm run test:ssr && npm run build",
|
|
72
|
+
"prepack": "npm run build",
|
|
73
|
+
"prepublishOnly": "npm run check"
|
|
74
|
+
},
|
|
75
|
+
"engines": {
|
|
76
|
+
"node": ">=22.12"
|
|
77
|
+
},
|
|
78
|
+
"overrides": {
|
|
79
|
+
"eslint-plugin-sonarjs": {
|
|
80
|
+
"typescript": "5.9.3"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"keywords": [
|
|
84
|
+
"accessible",
|
|
85
|
+
"calendar-heatmap",
|
|
86
|
+
"charting-library",
|
|
87
|
+
"charts",
|
|
88
|
+
"dashboard",
|
|
89
|
+
"data-visualization",
|
|
90
|
+
"dependency-free",
|
|
91
|
+
"bubble-chart",
|
|
92
|
+
"javascript",
|
|
93
|
+
"product-analytics",
|
|
94
|
+
"radar-chart",
|
|
95
|
+
"responsive-charts",
|
|
96
|
+
"scatter-plot",
|
|
97
|
+
"svg",
|
|
98
|
+
"svg-charts",
|
|
99
|
+
"timeline-chart",
|
|
100
|
+
"typescript",
|
|
101
|
+
"visualization"
|
|
102
|
+
],
|
|
103
|
+
"author": {
|
|
104
|
+
"name": "Alexander Chernyaev",
|
|
105
|
+
"url": "https://github.com/tabuna"
|
|
106
|
+
},
|
|
107
|
+
"license": "MIT",
|
|
108
|
+
"devDependencies": {
|
|
109
|
+
"@eslint/js": "^10.0.1",
|
|
110
|
+
"@vitest/browser-playwright": "^4.1.11",
|
|
111
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
112
|
+
"eslint": "^10.9.1",
|
|
113
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
114
|
+
"eslint-plugin-jsdoc": "^64.2.1",
|
|
115
|
+
"eslint-plugin-n": "^18.3.0",
|
|
116
|
+
"eslint-plugin-promise": "^7.3.0",
|
|
117
|
+
"eslint-plugin-security": "^4.0.1",
|
|
118
|
+
"eslint-plugin-sonarjs": "^4.2.0",
|
|
119
|
+
"eslint-plugin-unicorn": "^73.0.0",
|
|
120
|
+
"globals": "^17.11.0",
|
|
121
|
+
"playwright": "^1.62.1",
|
|
122
|
+
"prettier": "^3.9.6",
|
|
123
|
+
"prettier-plugin-multiline-arrays": "^4.1.11",
|
|
124
|
+
"sass": "^1.103.1",
|
|
125
|
+
"stylelint": "^17.14.1",
|
|
126
|
+
"stylelint-config-recess-order": "^7.8.0",
|
|
127
|
+
"stylelint-config-standard": "^40.0.0",
|
|
128
|
+
"terser": "^5.51.2",
|
|
129
|
+
"typescript": "^7.0.2",
|
|
130
|
+
"vite": "^8.2.2",
|
|
131
|
+
"vitest": "^4.1.11"
|
|
132
|
+
}
|
|
133
|
+
}
|