@carbon/charts-svelte 1.22.17 → 1.22.19
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 +18 -0
- package/README.md +35 -54
- package/dist/AlluvialChart.svelte +16 -15
- package/dist/AlluvialChart.svelte.d.ts +9 -32
- package/dist/AreaChart.svelte +16 -15
- package/dist/AreaChart.svelte.d.ts +9 -32
- package/dist/BarChartGrouped.svelte +16 -15
- package/dist/BarChartGrouped.svelte.d.ts +9 -32
- package/dist/BarChartSimple.svelte +16 -15
- package/dist/BarChartSimple.svelte.d.ts +9 -32
- package/dist/BarChartStacked.svelte +16 -14
- package/dist/BarChartStacked.svelte.d.ts +9 -32
- package/dist/BaseChart.svelte +24 -39
- package/dist/BaseChart.svelte.d.ts +32 -34
- package/dist/BoxplotChart.svelte +16 -15
- package/dist/BoxplotChart.svelte.d.ts +9 -32
- package/dist/BubbleChart.svelte +16 -15
- package/dist/BubbleChart.svelte.d.ts +9 -32
- package/dist/BulletChart.svelte +16 -15
- package/dist/BulletChart.svelte.d.ts +9 -32
- package/dist/ChoroplethChart.svelte +16 -15
- package/dist/ChoroplethChart.svelte.d.ts +9 -32
- package/dist/CirclePackChart.svelte +16 -15
- package/dist/CirclePackChart.svelte.d.ts +9 -32
- package/dist/ComboChart.svelte +16 -15
- package/dist/ComboChart.svelte.d.ts +9 -32
- package/dist/DonutChart.svelte +16 -15
- package/dist/DonutChart.svelte.d.ts +9 -32
- package/dist/GaugeChart.svelte +16 -15
- package/dist/GaugeChart.svelte.d.ts +9 -32
- package/dist/HeatmapChart.svelte +16 -15
- package/dist/HeatmapChart.svelte.d.ts +9 -32
- package/dist/HistogramChart.svelte +16 -15
- package/dist/HistogramChart.svelte.d.ts +9 -32
- package/dist/LineChart.svelte +16 -15
- package/dist/LineChart.svelte.d.ts +9 -32
- package/dist/LollipopChart.svelte +16 -15
- package/dist/LollipopChart.svelte.d.ts +9 -32
- package/dist/MeterChart.svelte +16 -15
- package/dist/MeterChart.svelte.d.ts +9 -32
- package/dist/PieChart.svelte +16 -15
- package/dist/PieChart.svelte.d.ts +9 -32
- package/dist/RadarChart.svelte +16 -15
- package/dist/RadarChart.svelte.d.ts +9 -32
- package/dist/ScatterChart.svelte +16 -15
- package/dist/ScatterChart.svelte.d.ts +9 -32
- package/dist/StackedAreaChart.svelte +16 -15
- package/dist/StackedAreaChart.svelte.d.ts +12 -32
- package/dist/TreeChart.svelte +16 -15
- package/dist/TreeChart.svelte.d.ts +9 -32
- package/dist/TreemapChart.svelte +16 -15
- package/dist/TreemapChart.svelte.d.ts +9 -32
- package/dist/WordCloudChart.svelte +16 -16
- package/dist/WordCloudChart.svelte.d.ts +9 -32
- package/dist/index.d.ts +141 -36
- package/dist/index.js +109 -31
- package/dist/interfaces.d.ts +24 -0
- package/dist/interfaces.js +1 -0
- package/dist/styles.css +4656 -4357
- package/dist/styles.css.map +1 -1
- package/dist/styles.min.css +7097 -1
- package/dist/styles.min.css.map +1 -1
- package/package.json +16 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.22.19 (2025-02-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @carbon/charts-svelte
|
|
9
|
+
|
|
10
|
+
# Change Log
|
|
11
|
+
|
|
12
|
+
All notable changes to this project will be documented in this file. See
|
|
13
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
14
|
+
|
|
15
|
+
## 1.22.18 (2025-02-18)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @carbon/charts-svelte
|
|
18
|
+
|
|
19
|
+
# Change Log
|
|
20
|
+
|
|
21
|
+
All notable changes to this project will be documented in this file. See
|
|
22
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
23
|
+
|
|
6
24
|
## 1.22.17 (2025-02-12)
|
|
7
25
|
|
|
8
26
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
</a>
|
|
5
5
|
<h3 align="center">Carbon Charts Svelte</h3>
|
|
6
6
|
<p align="center">
|
|
7
|
-
A component library of 26 charts for Svelte and SvelteKit.
|
|
7
|
+
A component library of 26 charts for Svelte 5.20+ and SvelteKit (optionally).
|
|
8
8
|
<br /><br />
|
|
9
9
|
<a href="https://www.npmjs.com/package/@carbon/charts">
|
|
10
10
|
<img src="https://img.shields.io/npm/v/@carbon/charts.svg" />
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
## Maintenance & support
|
|
23
23
|
|
|
24
|
-
These Svelte
|
|
24
|
+
These Svelte components were developed by Eric Liu and Nate Stuyvesant.
|
|
25
25
|
|
|
26
26
|
Please direct all questions regarding support, bug fixes and feature requests to
|
|
27
27
|
[@nstuyvesant](https://github.com/nstuyvesant) and [@metonym](https://github.com/metonym).
|
|
@@ -31,38 +31,42 @@ Please direct all questions regarding support, bug fixes and feature requests to
|
|
|
31
31
|
Run the following command using [npm](https://www.npmjs.com/):
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
npm install -D @carbon/charts-svelte
|
|
34
|
+
npm install -D @carbon/charts-svelte@next
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
If you prefer [Yarn](https://yarnpkg.com/en/), use the following command instead:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
yarn add -D @carbon/charts-svelte
|
|
40
|
+
yarn add -D @carbon/charts-svelte@next
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
The required styles should be imported from `@carbon/charts-svelte/styles.css`.
|
|
44
44
|
|
|
45
|
+
## Breaking Change
|
|
46
|
+
|
|
47
|
+
This release is for Svelte 5.20+ ONLY as it uses runes mode and passing of callback functions as
|
|
48
|
+
properties in place of event handlers. If you need support for Svelte 3 or 4, please use the
|
|
49
|
+
`latest`.
|
|
50
|
+
|
|
45
51
|
### SvelteKit
|
|
46
52
|
|
|
47
53
|
While this component library can be used with any build environments for Svelte,
|
|
48
54
|
[SvelteKit](https://kit.svelte.dev) is the official framework for building Svelte apps supporting
|
|
49
|
-
client
|
|
55
|
+
client and server-side rendering (SSR). SvelteKit is powered by [Vite](https://vitejs.dev).
|
|
50
56
|
|
|
51
57
|
The module `@carbon/charts` should not be externalized for SSR when building for production.
|
|
52
58
|
|
|
53
59
|
```js
|
|
54
|
-
// vite.config.
|
|
60
|
+
// vite.config.ts
|
|
55
61
|
import { sveltekit } from '@sveltejs/kit/vite'
|
|
62
|
+
import { defineConfig } from 'vite'
|
|
56
63
|
|
|
57
|
-
|
|
58
|
-
const config = {
|
|
64
|
+
export default defineConfig({
|
|
59
65
|
plugins: [sveltekit()],
|
|
60
66
|
ssr: {
|
|
61
67
|
noExternal: process.env.NODE_ENV === 'production' ? ['@carbon/charts'] : []
|
|
62
68
|
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export default config
|
|
69
|
+
})
|
|
66
70
|
```
|
|
67
71
|
|
|
68
72
|
#### Circular dependency warnings
|
|
@@ -104,39 +108,38 @@ import '@carbon/charts-svelte/styles.css'
|
|
|
104
108
|
}} />
|
|
105
109
|
```
|
|
106
110
|
|
|
107
|
-
###
|
|
111
|
+
### Lifecycle callbacks
|
|
108
112
|
|
|
109
|
-
|
|
113
|
+
Chart components fire the following callbacks:
|
|
110
114
|
|
|
111
|
-
- **
|
|
112
|
-
- **
|
|
113
|
-
- **
|
|
115
|
+
- **onload**: When the chart is instantiated
|
|
116
|
+
- **onupdate**: When `data` or `options` are updated
|
|
117
|
+
- **ondestroy**: When the component is unmounted and the chart is destroyed
|
|
114
118
|
|
|
115
119
|
```svelte
|
|
116
|
-
<BarChartSimple {data} {options}
|
|
120
|
+
<BarChartSimple {data} {options} {onload} {onupdate} {ondestroy} />
|
|
117
121
|
```
|
|
118
122
|
|
|
119
123
|
### Dynamic import
|
|
120
124
|
|
|
121
|
-
Dynamically
|
|
122
|
-
|
|
123
|
-
|
|
125
|
+
Dynamically importing a chart within `onMount()` avoids issues with server-side rendering (SSR). The
|
|
126
|
+
reason `@carbon/charts-svelte` does not work with SRR is because its dependency `@carbon/charts`
|
|
127
|
+
expects the window object to be present for fullscreen display.
|
|
124
128
|
|
|
125
129
|
```svelte
|
|
126
130
|
<script>
|
|
127
131
|
import '@carbon/charts-svelte/styles.css'
|
|
128
132
|
import { onMount } from 'svelte'
|
|
129
133
|
|
|
130
|
-
let
|
|
134
|
+
let Chart = $state()
|
|
131
135
|
|
|
132
136
|
onMount(async () => {
|
|
133
137
|
const charts = await import('@carbon/charts-svelte')
|
|
134
|
-
|
|
138
|
+
Chart = charts.BarChartSimple
|
|
135
139
|
})
|
|
136
140
|
</script>
|
|
137
141
|
|
|
138
|
-
<
|
|
139
|
-
this={chart}
|
|
142
|
+
<Chart
|
|
140
143
|
data={[
|
|
141
144
|
{ group: 'Qty', value: 65000 },
|
|
142
145
|
{ group: 'More', value: 29123 },
|
|
@@ -166,7 +169,7 @@ hovering over a bar.
|
|
|
166
169
|
import { onMount } from 'svelte'
|
|
167
170
|
import { BarChartSimple } from '@carbon/charts-svelte'
|
|
168
171
|
|
|
169
|
-
let chart
|
|
172
|
+
let chart = $state()
|
|
170
173
|
|
|
171
174
|
function barMouseOver(e) {
|
|
172
175
|
console.log(e.detail)
|
|
@@ -200,11 +203,6 @@ hovering over a bar.
|
|
|
200
203
|
}} />
|
|
201
204
|
```
|
|
202
205
|
|
|
203
|
-
## TypeScript support
|
|
204
|
-
|
|
205
|
-
Svelte version 3.31 or greater is required to use this library with TypeScript. Svelte 4.x+ is
|
|
206
|
-
recommended.
|
|
207
|
-
|
|
208
206
|
### Enums and types
|
|
209
207
|
|
|
210
208
|
For your convenience, enums and types from `@carbon/charts` are re-exported from
|
|
@@ -226,22 +224,6 @@ const options: BarChartOptions = {
|
|
|
226
224
|
}
|
|
227
225
|
```
|
|
228
226
|
|
|
229
|
-
### Component type
|
|
230
|
-
|
|
231
|
-
Use the `ComponentType` utility type from `svelte` to extract the component type for chart
|
|
232
|
-
components.
|
|
233
|
-
|
|
234
|
-
```ts
|
|
235
|
-
import { onMount, type ComponentType } from 'svelte'
|
|
236
|
-
import type { BarChartSimple } from '@carbon/charts-svelte'
|
|
237
|
-
|
|
238
|
-
let component: ComponentType<BarChartSimple> = null
|
|
239
|
-
|
|
240
|
-
onMount(async () => {
|
|
241
|
-
component = (await import('@carbon/charts-svelte')).BarChartSimple
|
|
242
|
-
})
|
|
243
|
-
```
|
|
244
|
-
|
|
245
227
|
### Component props
|
|
246
228
|
|
|
247
229
|
Use the `ComponentProps` utility type from `svelte` to extract the props for chart components.
|
|
@@ -251,20 +233,19 @@ You can then use an
|
|
|
251
233
|
extract types for individual properties.
|
|
252
234
|
|
|
253
235
|
```ts
|
|
254
|
-
import {
|
|
236
|
+
import type { ComponentProps } from 'svelte'
|
|
255
237
|
import { BarChartSimple } from '@carbon/charts-svelte'
|
|
238
|
+
import { options } from './options'
|
|
239
|
+
import { data } from './data'
|
|
256
240
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
// Indexed access type to access the type of the `chart` property
|
|
260
|
-
let chart: ChartProps['chart'] = null
|
|
241
|
+
// Errors if these aren't the correct props expected by BarChartSimple
|
|
242
|
+
const props: ComponentProps<typeof BarChartSimple> = { options, data }
|
|
261
243
|
```
|
|
262
244
|
|
|
263
245
|
## <picture><source height="20" width="20" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-dark.svg"><source height="20" width="20" media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"><img height="20" width="20" alt="IBM Telemetry" src="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"></picture> IBM Telemetry
|
|
264
246
|
|
|
265
|
-
This package uses IBM Telemetry to collect de-identified and anonymized metrics
|
|
266
|
-
|
|
267
|
-
collection. To opt out, see
|
|
247
|
+
This package uses IBM Telemetry to collect de-identified and anonymized metrics data. By installing
|
|
248
|
+
this package as a dependency you are agreeing to telemetry collection. To opt out, see
|
|
268
249
|
[Opting out of IBM Telemetry data collection](https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection).
|
|
269
250
|
For more information on the data being collected, please see the
|
|
270
251
|
[IBM Telemetry documentation](https://github.com/ibm-telemetry/telemetry-js/tree/main#ibm-telemetry-collection-basics).
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
AlluvialChart as AlluvialChartCore,
|
|
4
|
-
type AlluvialChartOptions,
|
|
5
|
-
type ChartTabularData
|
|
6
|
-
} from '@carbon/charts'
|
|
1
|
+
<script>
|
|
2
|
+
import { AlluvialChart as AlluvialChartCore } from '@carbon/charts'
|
|
7
3
|
import BaseChart from './BaseChart.svelte'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
let {
|
|
5
|
+
data,
|
|
6
|
+
options,
|
|
7
|
+
ref = $bindable(),
|
|
8
|
+
chart = $bindable(),
|
|
9
|
+
onload,
|
|
10
|
+
onupdate,
|
|
11
|
+
ondestroy,
|
|
12
|
+
...rest
|
|
13
|
+
} = $props()
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<BaseChart
|
|
16
|
-
{...$$restProps}
|
|
17
17
|
Chart={AlluvialChartCore}
|
|
18
18
|
{options}
|
|
19
19
|
{data}
|
|
20
20
|
bind:ref
|
|
21
21
|
bind:chart
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
{onload}
|
|
23
|
+
{onupdate}
|
|
24
|
+
{ondestroy}
|
|
25
|
+
{...rest} />
|
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
import { AlluvialChart as AlluvialChartCore, type AlluvialChartOptions
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const AlluvialChart: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
[x: string]: any;
|
|
17
|
-
options: AlluvialChartOptions;
|
|
18
|
-
data: ChartTabularData;
|
|
19
|
-
chart?: AlluvialChartCore | undefined;
|
|
20
|
-
ref?: HTMLDivElement | undefined;
|
|
21
|
-
}, {
|
|
22
|
-
load: CustomEvent<null>;
|
|
23
|
-
update: CustomEvent<{
|
|
24
|
-
data: ChartTabularData;
|
|
25
|
-
options: import("@carbon/charts").BaseChartOptions;
|
|
26
|
-
}>;
|
|
27
|
-
destroy: CustomEvent<null>;
|
|
28
|
-
} & {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
}, {}, {}, string>;
|
|
31
|
-
type AlluvialChart = InstanceType<typeof AlluvialChart>;
|
|
32
|
-
export default AlluvialChart;
|
|
1
|
+
import { AlluvialChart as AlluvialChartCore, type AlluvialChartOptions } from '@carbon/charts'
|
|
2
|
+
import type { ChartProps } from './interfaces'
|
|
3
|
+
declare const AlluvialChart: import('svelte').Component<
|
|
4
|
+
ChartProps<AlluvialChartCore, AlluvialChartOptions>,
|
|
5
|
+
{},
|
|
6
|
+
'ref' | 'chart'
|
|
7
|
+
>
|
|
8
|
+
type AlluvialChart = ReturnType<typeof AlluvialChart>
|
|
9
|
+
export default AlluvialChart
|
package/dist/AreaChart.svelte
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
AreaChart as AreaChartCore,
|
|
4
|
-
type AreaChartOptions,
|
|
5
|
-
type ChartTabularData
|
|
6
|
-
} from '@carbon/charts'
|
|
1
|
+
<script>
|
|
2
|
+
import { AreaChart as AreaChartCore } from '@carbon/charts'
|
|
7
3
|
import BaseChart from './BaseChart.svelte'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
let {
|
|
5
|
+
data,
|
|
6
|
+
options,
|
|
7
|
+
ref = $bindable(),
|
|
8
|
+
chart = $bindable(),
|
|
9
|
+
onload,
|
|
10
|
+
onupdate,
|
|
11
|
+
ondestroy,
|
|
12
|
+
...rest
|
|
13
|
+
} = $props()
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<BaseChart
|
|
16
|
-
{...$$restProps}
|
|
17
17
|
Chart={AreaChartCore}
|
|
18
18
|
{options}
|
|
19
19
|
{data}
|
|
20
20
|
bind:ref
|
|
21
21
|
bind:chart
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
{onload}
|
|
23
|
+
{onupdate}
|
|
24
|
+
{ondestroy}
|
|
25
|
+
{...rest} />
|
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
import { AreaChart as AreaChartCore, type AreaChartOptions
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const AreaChart: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
[x: string]: any;
|
|
17
|
-
options: AreaChartOptions;
|
|
18
|
-
data: ChartTabularData;
|
|
19
|
-
chart?: AreaChartCore | undefined;
|
|
20
|
-
ref?: HTMLDivElement | undefined;
|
|
21
|
-
}, {
|
|
22
|
-
load: CustomEvent<null>;
|
|
23
|
-
update: CustomEvent<{
|
|
24
|
-
data: ChartTabularData;
|
|
25
|
-
options: import("@carbon/charts").BaseChartOptions;
|
|
26
|
-
}>;
|
|
27
|
-
destroy: CustomEvent<null>;
|
|
28
|
-
} & {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
}, {}, {}, string>;
|
|
31
|
-
type AreaChart = InstanceType<typeof AreaChart>;
|
|
32
|
-
export default AreaChart;
|
|
1
|
+
import { AreaChart as AreaChartCore, type AreaChartOptions } from '@carbon/charts'
|
|
2
|
+
import type { ChartProps } from './interfaces'
|
|
3
|
+
declare const AreaChart: import('svelte').Component<
|
|
4
|
+
ChartProps<AreaChartCore, AreaChartOptions>,
|
|
5
|
+
{},
|
|
6
|
+
'ref' | 'chart'
|
|
7
|
+
>
|
|
8
|
+
type AreaChart = ReturnType<typeof AreaChart>
|
|
9
|
+
export default AreaChart
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
GroupedBarChart as GroupedBarChartCore,
|
|
4
|
-
type BarChartOptions,
|
|
5
|
-
type ChartTabularData
|
|
6
|
-
} from '@carbon/charts'
|
|
1
|
+
<script>
|
|
2
|
+
import { GroupedBarChart as GroupedBarChartCore } from '@carbon/charts'
|
|
7
3
|
import BaseChart from './BaseChart.svelte'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
let {
|
|
5
|
+
data,
|
|
6
|
+
options,
|
|
7
|
+
ref = $bindable(),
|
|
8
|
+
chart = $bindable(),
|
|
9
|
+
onload,
|
|
10
|
+
onupdate,
|
|
11
|
+
ondestroy,
|
|
12
|
+
...rest
|
|
13
|
+
} = $props()
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<BaseChart
|
|
16
|
-
{...$$restProps}
|
|
17
17
|
Chart={GroupedBarChartCore}
|
|
18
18
|
{options}
|
|
19
19
|
{data}
|
|
20
20
|
bind:ref
|
|
21
21
|
bind:chart
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
{onload}
|
|
23
|
+
{onupdate}
|
|
24
|
+
{ondestroy}
|
|
25
|
+
{...rest} />
|
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
import { GroupedBarChart as GroupedBarChartCore, type BarChartOptions
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const BarChartGrouped: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
[x: string]: any;
|
|
17
|
-
options: BarChartOptions;
|
|
18
|
-
data: ChartTabularData;
|
|
19
|
-
chart?: GroupedBarChartCore | undefined;
|
|
20
|
-
ref?: HTMLDivElement | undefined;
|
|
21
|
-
}, {
|
|
22
|
-
load: CustomEvent<null>;
|
|
23
|
-
update: CustomEvent<{
|
|
24
|
-
data: ChartTabularData;
|
|
25
|
-
options: import("@carbon/charts").BaseChartOptions;
|
|
26
|
-
}>;
|
|
27
|
-
destroy: CustomEvent<null>;
|
|
28
|
-
} & {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
}, {}, {}, string>;
|
|
31
|
-
type BarChartGrouped = InstanceType<typeof BarChartGrouped>;
|
|
32
|
-
export default BarChartGrouped;
|
|
1
|
+
import { GroupedBarChart as GroupedBarChartCore, type BarChartOptions } from '@carbon/charts'
|
|
2
|
+
import type { ChartProps } from './interfaces'
|
|
3
|
+
declare const BarChartGrouped: import('svelte').Component<
|
|
4
|
+
ChartProps<GroupedBarChartCore, BarChartOptions>,
|
|
5
|
+
{},
|
|
6
|
+
'ref' | 'chart'
|
|
7
|
+
>
|
|
8
|
+
type BarChartGrouped = ReturnType<typeof BarChartGrouped>
|
|
9
|
+
export default BarChartGrouped
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
SimpleBarChart as SimpleBarChartCore,
|
|
4
|
-
type BarChartOptions,
|
|
5
|
-
type ChartTabularData
|
|
6
|
-
} from '@carbon/charts'
|
|
1
|
+
<script>
|
|
2
|
+
import { SimpleBarChart as SimpleBarChartCore } from '@carbon/charts'
|
|
7
3
|
import BaseChart from './BaseChart.svelte'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
let {
|
|
5
|
+
data,
|
|
6
|
+
options,
|
|
7
|
+
ref = $bindable(),
|
|
8
|
+
chart = $bindable(),
|
|
9
|
+
onload,
|
|
10
|
+
onupdate,
|
|
11
|
+
ondestroy,
|
|
12
|
+
...rest
|
|
13
|
+
} = $props()
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<BaseChart
|
|
16
|
-
{...$$restProps}
|
|
17
17
|
Chart={SimpleBarChartCore}
|
|
18
18
|
{options}
|
|
19
19
|
{data}
|
|
20
20
|
bind:ref
|
|
21
21
|
bind:chart
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
{onload}
|
|
23
|
+
{onupdate}
|
|
24
|
+
{ondestroy}
|
|
25
|
+
{...rest} />
|
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
import { SimpleBarChart as SimpleBarChartCore, type BarChartOptions
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const BarChartSimple: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
[x: string]: any;
|
|
17
|
-
options: BarChartOptions;
|
|
18
|
-
data: ChartTabularData;
|
|
19
|
-
chart?: SimpleBarChartCore | undefined;
|
|
20
|
-
ref?: HTMLDivElement | undefined;
|
|
21
|
-
}, {
|
|
22
|
-
load: CustomEvent<null>;
|
|
23
|
-
update: CustomEvent<{
|
|
24
|
-
data: ChartTabularData;
|
|
25
|
-
options: import("@carbon/charts").BaseChartOptions;
|
|
26
|
-
}>;
|
|
27
|
-
destroy: CustomEvent<null>;
|
|
28
|
-
} & {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
}, {}, {}, string>;
|
|
31
|
-
type BarChartSimple = InstanceType<typeof BarChartSimple>;
|
|
32
|
-
export default BarChartSimple;
|
|
1
|
+
import { SimpleBarChart as SimpleBarChartCore, type BarChartOptions } from '@carbon/charts'
|
|
2
|
+
import type { ChartProps } from './interfaces'
|
|
3
|
+
declare const BarChartSimple: import('svelte').Component<
|
|
4
|
+
ChartProps<SimpleBarChartCore, BarChartOptions>,
|
|
5
|
+
{},
|
|
6
|
+
'ref' | 'chart'
|
|
7
|
+
>
|
|
8
|
+
type BarChartSimple = ReturnType<typeof BarChartSimple>
|
|
9
|
+
export default BarChartSimple
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
StackedBarChart as StackedBarChartCore,
|
|
4
|
-
type BarChartOptions,
|
|
5
|
-
type ChartTabularData
|
|
6
|
-
} from '@carbon/charts'
|
|
1
|
+
<script>
|
|
2
|
+
import { StackedBarChart as StackedBarChartCore } from '@carbon/charts'
|
|
7
3
|
import BaseChart from './BaseChart.svelte'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
let {
|
|
5
|
+
data,
|
|
6
|
+
options,
|
|
7
|
+
ref = $bindable(),
|
|
8
|
+
chart = $bindable(),
|
|
9
|
+
onload,
|
|
10
|
+
onupdate,
|
|
11
|
+
ondestroy,
|
|
12
|
+
...rest
|
|
13
|
+
} = $props()
|
|
12
14
|
</script>
|
|
13
15
|
|
|
14
16
|
<BaseChart
|
|
15
|
-
{...$$restProps}
|
|
16
17
|
Chart={StackedBarChartCore}
|
|
17
18
|
{options}
|
|
18
19
|
{data}
|
|
19
20
|
bind:ref
|
|
20
21
|
bind:chart
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
{onload}
|
|
23
|
+
{onupdate}
|
|
24
|
+
{ondestroy}
|
|
25
|
+
{...rest} />
|
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
import { StackedBarChart as StackedBarChartCore, type BarChartOptions
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const BarChartStacked: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
-
[x: string]: any;
|
|
17
|
-
options: BarChartOptions;
|
|
18
|
-
data: ChartTabularData;
|
|
19
|
-
chart?: StackedBarChartCore | undefined;
|
|
20
|
-
ref?: HTMLDivElement | undefined;
|
|
21
|
-
}, {
|
|
22
|
-
load: CustomEvent<null>;
|
|
23
|
-
update: CustomEvent<{
|
|
24
|
-
data: ChartTabularData;
|
|
25
|
-
options: import("@carbon/charts").BaseChartOptions;
|
|
26
|
-
}>;
|
|
27
|
-
destroy: CustomEvent<null>;
|
|
28
|
-
} & {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
}, {}, {}, string>;
|
|
31
|
-
type BarChartStacked = InstanceType<typeof BarChartStacked>;
|
|
32
|
-
export default BarChartStacked;
|
|
1
|
+
import { StackedBarChart as StackedBarChartCore, type BarChartOptions } from '@carbon/charts'
|
|
2
|
+
import type { ChartProps } from './interfaces'
|
|
3
|
+
declare const BarChartStacked: import('svelte').Component<
|
|
4
|
+
ChartProps<StackedBarChartCore, BarChartOptions>,
|
|
5
|
+
{},
|
|
6
|
+
'ref' | 'chart'
|
|
7
|
+
>
|
|
8
|
+
type BarChartStacked = ReturnType<typeof BarChartStacked>
|
|
9
|
+
export default BarChartStacked
|