@carbon/charts-svelte 1.22.16 → 1.22.18
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 +22 -0
- package/README.md +4 -2
- package/dist/AlluvialChart.svelte +6 -11
- package/dist/AlluvialChart.svelte.d.ts +34 -31
- package/dist/AreaChart.svelte +6 -11
- package/dist/AreaChart.svelte.d.ts +34 -31
- package/dist/BarChartGrouped.svelte +6 -11
- package/dist/BarChartGrouped.svelte.d.ts +34 -31
- package/dist/BarChartSimple.svelte +6 -11
- package/dist/BarChartSimple.svelte.d.ts +34 -31
- package/dist/BarChartStacked.svelte +6 -10
- package/dist/BarChartStacked.svelte.d.ts +34 -31
- package/dist/BaseChart.svelte +9 -24
- package/dist/BaseChart.svelte.d.ts +31 -35
- package/dist/BoxplotChart.svelte +6 -11
- package/dist/BoxplotChart.svelte.d.ts +34 -31
- package/dist/BubbleChart.svelte +6 -11
- package/dist/BubbleChart.svelte.d.ts +34 -31
- package/dist/BulletChart.svelte +6 -11
- package/dist/BulletChart.svelte.d.ts +34 -31
- package/dist/ChoroplethChart.svelte +6 -11
- package/dist/ChoroplethChart.svelte.d.ts +34 -31
- package/dist/CirclePackChart.svelte +6 -11
- package/dist/CirclePackChart.svelte.d.ts +34 -31
- package/dist/ComboChart.svelte +6 -11
- package/dist/ComboChart.svelte.d.ts +34 -31
- package/dist/DonutChart.svelte +6 -11
- package/dist/DonutChart.svelte.d.ts +34 -31
- package/dist/GaugeChart.svelte +6 -11
- package/dist/GaugeChart.svelte.d.ts +34 -31
- package/dist/HeatmapChart.svelte +6 -11
- package/dist/HeatmapChart.svelte.d.ts +34 -31
- package/dist/HistogramChart.svelte +6 -11
- package/dist/HistogramChart.svelte.d.ts +34 -31
- package/dist/LineChart.svelte +6 -11
- package/dist/LineChart.svelte.d.ts +34 -31
- package/dist/LollipopChart.svelte +6 -11
- package/dist/LollipopChart.svelte.d.ts +34 -31
- package/dist/MeterChart.svelte +6 -11
- package/dist/MeterChart.svelte.d.ts +34 -31
- package/dist/PieChart.svelte +6 -11
- package/dist/PieChart.svelte.d.ts +34 -31
- package/dist/RadarChart.svelte +6 -11
- package/dist/RadarChart.svelte.d.ts +34 -31
- package/dist/ScatterChart.svelte +6 -11
- package/dist/ScatterChart.svelte.d.ts +34 -31
- package/dist/StackedAreaChart.svelte +6 -11
- package/dist/StackedAreaChart.svelte.d.ts +34 -31
- package/dist/TreeChart.svelte +6 -11
- package/dist/TreeChart.svelte.d.ts +34 -31
- package/dist/TreemapChart.svelte +6 -11
- package/dist/TreemapChart.svelte.d.ts +34 -31
- package/dist/WordCloudChart.svelte +6 -12
- package/dist/WordCloudChart.svelte.d.ts +35 -31
- package/dist/index.d.ts +141 -36
- package/dist/index.js +109 -31
- package/dist/styles.css +4458 -4357
- package/dist/styles.min.css +6900 -1
- package/package.json +14 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.18 (2025-02-18)
|
|
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.17 (2025-02-12)
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
- **stackblitz:** react examples
|
|
20
|
+
([#1957](https://github.com/carbon-design-system/carbon-charts/issues/1957))
|
|
21
|
+
([1427786](https://github.com/carbon-design-system/carbon-charts/commit/14277866a0933eb99b1097818d4611cc140b9da2))
|
|
22
|
+
|
|
23
|
+
# Change Log
|
|
24
|
+
|
|
25
|
+
All notable changes to this project will be documented in this file. See
|
|
26
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
27
|
+
|
|
6
28
|
## 1.22.16 (2025-02-10)
|
|
7
29
|
|
|
8
30
|
**Note:** Version bump only for package @carbon/charts-svelte
|
package/README.md
CHANGED
|
@@ -42,6 +42,8 @@ yarn add -D @carbon/charts-svelte
|
|
|
42
42
|
|
|
43
43
|
The required styles should be imported from `@carbon/charts-svelte/styles.css`.
|
|
44
44
|
|
|
45
|
+
A release in the near future will move components to runes mode for Svelte 5 and beyond. As this would be a breaking change because event handlers will change to component properties, this version will be published with the distribution tag `next`. Please check <a href="https://www.npmjs.com/package/@carbon/charts-svelte?activeTab=versions">here</a> to see if a version for `latest` has been published.
|
|
46
|
+
|
|
45
47
|
### SvelteKit
|
|
46
48
|
|
|
47
49
|
While this component library can be used with any build environments for Svelte,
|
|
@@ -200,9 +202,9 @@ hovering over a bar.
|
|
|
200
202
|
}} />
|
|
201
203
|
```
|
|
202
204
|
|
|
203
|
-
## TypeScript support
|
|
205
|
+
## Svelte and TypeScript support
|
|
204
206
|
|
|
205
|
-
Svelte
|
|
207
|
+
Svelte 3.31 or greater is required to use this library with TypeScript. Svelte 5.20+ is
|
|
206
208
|
recommended.
|
|
207
209
|
|
|
208
210
|
### Enums and types
|
|
@@ -1,15 +1,10 @@
|
|
|
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
|
-
export let
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
export let ref: HTMLDivElement | undefined = undefined
|
|
4
|
+
export let options
|
|
5
|
+
export let data
|
|
6
|
+
export let chart = undefined
|
|
7
|
+
export let ref = undefined
|
|
13
8
|
</script>
|
|
14
9
|
|
|
15
10
|
<BaseChart
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { SvelteComponentTyped } from 'svelte'
|
|
2
|
+
import {
|
|
3
|
+
AlluvialChart as AlluvialChartCore,
|
|
4
|
+
type AlluvialChartOptions,
|
|
5
|
+
type ChartTabularData
|
|
6
|
+
} from '@carbon/charts'
|
|
7
|
+
declare const __propDef: {
|
|
8
|
+
props: {
|
|
9
|
+
[x: string]: any
|
|
10
|
+
options: AlluvialChartOptions
|
|
11
|
+
data: ChartTabularData
|
|
12
|
+
chart?: AlluvialChartCore | undefined
|
|
13
|
+
ref?: HTMLDivElement | undefined
|
|
14
|
+
}
|
|
15
|
+
events: {
|
|
16
|
+
load: CustomEvent<null>
|
|
17
|
+
update: CustomEvent<{
|
|
18
|
+
data: ChartTabularData
|
|
19
|
+
options: import('@carbon/charts').BaseChartOptions
|
|
20
|
+
}>
|
|
21
|
+
destroy: CustomEvent<null>
|
|
22
|
+
} & {
|
|
23
|
+
[evt: string]: CustomEvent<any>
|
|
24
|
+
}
|
|
25
|
+
slots: {}
|
|
14
26
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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;
|
|
27
|
+
export type AlluvialChartProps = typeof __propDef.props
|
|
28
|
+
export type AlluvialChartEvents = typeof __propDef.events
|
|
29
|
+
export type AlluvialChartSlots = typeof __propDef.slots
|
|
30
|
+
export default class AlluvialChart extends SvelteComponentTyped<
|
|
31
|
+
AlluvialChartProps,
|
|
32
|
+
AlluvialChartEvents,
|
|
33
|
+
AlluvialChartSlots
|
|
34
|
+
> {}
|
|
35
|
+
export {}
|
package/dist/AreaChart.svelte
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
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
|
-
export let
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
export let ref: HTMLDivElement | undefined = undefined
|
|
4
|
+
export let options
|
|
5
|
+
export let data
|
|
6
|
+
export let chart = undefined
|
|
7
|
+
export let ref = undefined
|
|
13
8
|
</script>
|
|
14
9
|
|
|
15
10
|
<BaseChart
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { SvelteComponentTyped } from 'svelte'
|
|
2
|
+
import {
|
|
3
|
+
AreaChart as AreaChartCore,
|
|
4
|
+
type AreaChartOptions,
|
|
5
|
+
type ChartTabularData
|
|
6
|
+
} from '@carbon/charts'
|
|
7
|
+
declare const __propDef: {
|
|
8
|
+
props: {
|
|
9
|
+
[x: string]: any
|
|
10
|
+
options: AreaChartOptions
|
|
11
|
+
data: ChartTabularData
|
|
12
|
+
chart?: AreaChartCore | undefined
|
|
13
|
+
ref?: HTMLDivElement | undefined
|
|
14
|
+
}
|
|
15
|
+
events: {
|
|
16
|
+
load: CustomEvent<null>
|
|
17
|
+
update: CustomEvent<{
|
|
18
|
+
data: ChartTabularData
|
|
19
|
+
options: import('@carbon/charts').BaseChartOptions
|
|
20
|
+
}>
|
|
21
|
+
destroy: CustomEvent<null>
|
|
22
|
+
} & {
|
|
23
|
+
[evt: string]: CustomEvent<any>
|
|
24
|
+
}
|
|
25
|
+
slots: {}
|
|
14
26
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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;
|
|
27
|
+
export type AreaChartProps = typeof __propDef.props
|
|
28
|
+
export type AreaChartEvents = typeof __propDef.events
|
|
29
|
+
export type AreaChartSlots = typeof __propDef.slots
|
|
30
|
+
export default class AreaChart extends SvelteComponentTyped<
|
|
31
|
+
AreaChartProps,
|
|
32
|
+
AreaChartEvents,
|
|
33
|
+
AreaChartSlots
|
|
34
|
+
> {}
|
|
35
|
+
export {}
|
|
@@ -1,15 +1,10 @@
|
|
|
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
|
-
export let
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
export let ref: HTMLDivElement | undefined = undefined
|
|
4
|
+
export let options
|
|
5
|
+
export let data
|
|
6
|
+
export let chart = undefined
|
|
7
|
+
export let ref = undefined
|
|
13
8
|
</script>
|
|
14
9
|
|
|
15
10
|
<BaseChart
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { SvelteComponentTyped } from 'svelte'
|
|
2
|
+
import {
|
|
3
|
+
GroupedBarChart as GroupedBarChartCore,
|
|
4
|
+
type BarChartOptions,
|
|
5
|
+
type ChartTabularData
|
|
6
|
+
} from '@carbon/charts'
|
|
7
|
+
declare const __propDef: {
|
|
8
|
+
props: {
|
|
9
|
+
[x: string]: any
|
|
10
|
+
options: BarChartOptions
|
|
11
|
+
data: ChartTabularData
|
|
12
|
+
chart?: GroupedBarChartCore | undefined
|
|
13
|
+
ref?: HTMLDivElement | undefined
|
|
14
|
+
}
|
|
15
|
+
events: {
|
|
16
|
+
load: CustomEvent<null>
|
|
17
|
+
update: CustomEvent<{
|
|
18
|
+
data: ChartTabularData
|
|
19
|
+
options: import('@carbon/charts').BaseChartOptions
|
|
20
|
+
}>
|
|
21
|
+
destroy: CustomEvent<null>
|
|
22
|
+
} & {
|
|
23
|
+
[evt: string]: CustomEvent<any>
|
|
24
|
+
}
|
|
25
|
+
slots: {}
|
|
14
26
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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;
|
|
27
|
+
export type BarChartGroupedProps = typeof __propDef.props
|
|
28
|
+
export type BarChartGroupedEvents = typeof __propDef.events
|
|
29
|
+
export type BarChartGroupedSlots = typeof __propDef.slots
|
|
30
|
+
export default class BarChartGrouped extends SvelteComponentTyped<
|
|
31
|
+
BarChartGroupedProps,
|
|
32
|
+
BarChartGroupedEvents,
|
|
33
|
+
BarChartGroupedSlots
|
|
34
|
+
> {}
|
|
35
|
+
export {}
|
|
@@ -1,15 +1,10 @@
|
|
|
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
|
-
export let
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
export let ref: HTMLDivElement | undefined = undefined
|
|
4
|
+
export let options
|
|
5
|
+
export let data
|
|
6
|
+
export let chart = undefined
|
|
7
|
+
export let ref = undefined
|
|
13
8
|
</script>
|
|
14
9
|
|
|
15
10
|
<BaseChart
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { SvelteComponentTyped } from 'svelte'
|
|
2
|
+
import {
|
|
3
|
+
SimpleBarChart as SimpleBarChartCore,
|
|
4
|
+
type BarChartOptions,
|
|
5
|
+
type ChartTabularData
|
|
6
|
+
} from '@carbon/charts'
|
|
7
|
+
declare const __propDef: {
|
|
8
|
+
props: {
|
|
9
|
+
[x: string]: any
|
|
10
|
+
options: BarChartOptions
|
|
11
|
+
data: ChartTabularData
|
|
12
|
+
chart?: SimpleBarChartCore | undefined
|
|
13
|
+
ref?: HTMLDivElement | undefined
|
|
14
|
+
}
|
|
15
|
+
events: {
|
|
16
|
+
load: CustomEvent<null>
|
|
17
|
+
update: CustomEvent<{
|
|
18
|
+
data: ChartTabularData
|
|
19
|
+
options: import('@carbon/charts').BaseChartOptions
|
|
20
|
+
}>
|
|
21
|
+
destroy: CustomEvent<null>
|
|
22
|
+
} & {
|
|
23
|
+
[evt: string]: CustomEvent<any>
|
|
24
|
+
}
|
|
25
|
+
slots: {}
|
|
14
26
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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;
|
|
27
|
+
export type BarChartSimpleProps = typeof __propDef.props
|
|
28
|
+
export type BarChartSimpleEvents = typeof __propDef.events
|
|
29
|
+
export type BarChartSimpleSlots = typeof __propDef.slots
|
|
30
|
+
export default class BarChartSimple extends SvelteComponentTyped<
|
|
31
|
+
BarChartSimpleProps,
|
|
32
|
+
BarChartSimpleEvents,
|
|
33
|
+
BarChartSimpleSlots
|
|
34
|
+
> {}
|
|
35
|
+
export {}
|
|
@@ -1,14 +1,10 @@
|
|
|
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
|
-
export let options
|
|
9
|
-
export let data
|
|
10
|
-
export let chart
|
|
11
|
-
export let ref
|
|
4
|
+
export let options
|
|
5
|
+
export let data
|
|
6
|
+
export let chart = undefined
|
|
7
|
+
export let ref = undefined
|
|
12
8
|
</script>
|
|
13
9
|
|
|
14
10
|
<BaseChart
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { SvelteComponentTyped } from 'svelte'
|
|
2
|
+
import {
|
|
3
|
+
StackedBarChart as StackedBarChartCore,
|
|
4
|
+
type BarChartOptions,
|
|
5
|
+
type ChartTabularData
|
|
6
|
+
} from '@carbon/charts'
|
|
7
|
+
declare const __propDef: {
|
|
8
|
+
props: {
|
|
9
|
+
[x: string]: any
|
|
10
|
+
options: BarChartOptions
|
|
11
|
+
data: ChartTabularData
|
|
12
|
+
chart?: StackedBarChartCore | undefined
|
|
13
|
+
ref?: HTMLDivElement | undefined
|
|
14
|
+
}
|
|
15
|
+
events: {
|
|
16
|
+
load: CustomEvent<null>
|
|
17
|
+
update: CustomEvent<{
|
|
18
|
+
data: ChartTabularData
|
|
19
|
+
options: import('@carbon/charts').BaseChartOptions
|
|
20
|
+
}>
|
|
21
|
+
destroy: CustomEvent<null>
|
|
22
|
+
} & {
|
|
23
|
+
[evt: string]: CustomEvent<any>
|
|
24
|
+
}
|
|
25
|
+
slots: {}
|
|
14
26
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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;
|
|
27
|
+
export type BarChartStackedProps = typeof __propDef.props
|
|
28
|
+
export type BarChartStackedEvents = typeof __propDef.events
|
|
29
|
+
export type BarChartStackedSlots = typeof __propDef.slots
|
|
30
|
+
export default class BarChartStacked extends SvelteComponentTyped<
|
|
31
|
+
BarChartStackedProps,
|
|
32
|
+
BarChartStackedEvents,
|
|
33
|
+
BarChartStackedSlots
|
|
34
|
+
> {}
|
|
35
|
+
export {}
|
package/dist/BaseChart.svelte
CHANGED
|
@@ -1,35 +1,21 @@
|
|
|
1
|
-
<script
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1
|
+
<script generics="T extends BaseChartOptions">
|
|
3
2
|
import { onMount, afterUpdate, onDestroy, createEventDispatcher } from 'svelte'
|
|
4
|
-
import type { Charts, ChartConfig, BaseChartOptions, ChartTabularData } from '@carbon/charts'
|
|
5
|
-
|
|
6
|
-
interface DispatchedEvents {
|
|
7
|
-
load: null
|
|
8
|
-
update: { data: ChartTabularData; options: T }
|
|
9
|
-
destroy: null
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
type CoreChartClass = new (holder: HTMLDivElement, chartConfigs: ChartConfig<T>) => Charts
|
|
13
|
-
|
|
14
3
|
const chartHolderCssClass = 'cds--chart-holder' // Used by Carbon Charts CSS
|
|
15
|
-
export let data
|
|
16
|
-
export let options
|
|
17
|
-
export let Chart
|
|
18
|
-
export let chart
|
|
19
|
-
export let ref
|
|
4
|
+
export let data = [] // Chart data, default is empty
|
|
5
|
+
export let options = {} // Specific chart option type, default is empty
|
|
6
|
+
export let Chart // Used to instantiate next property
|
|
7
|
+
export let chart // Instance of the chart class
|
|
8
|
+
export let ref // Binding to chart 'holder' in template below
|
|
20
9
|
export let id = `chart-${Math.random().toString(36)}` // id for chart holder element
|
|
21
|
-
|
|
22
|
-
const dispatch = createEventDispatcher<DispatchedEvents>()
|
|
23
|
-
|
|
10
|
+
const dispatch = createEventDispatcher()
|
|
24
11
|
onMount(() => {
|
|
25
12
|
try {
|
|
26
|
-
chart = new Chart(ref
|
|
13
|
+
chart = new Chart(ref, { data, options })
|
|
27
14
|
dispatch('load')
|
|
28
15
|
} catch (error) {
|
|
29
16
|
console.error('Failed to initialize chart:', error)
|
|
30
17
|
}
|
|
31
18
|
})
|
|
32
|
-
|
|
33
19
|
afterUpdate(() => {
|
|
34
20
|
if (chart) {
|
|
35
21
|
try {
|
|
@@ -41,11 +27,10 @@
|
|
|
41
27
|
}
|
|
42
28
|
}
|
|
43
29
|
})
|
|
44
|
-
|
|
45
30
|
onDestroy(() => {
|
|
46
31
|
if (chart) {
|
|
47
32
|
dispatch('destroy')
|
|
48
|
-
// Like core's Chart.destroy() but keeps div chart holder bound to ref as it's part of
|
|
33
|
+
// Like core's Chart.destroy() but keeps div chart holder bound to ref as it's part of this template
|
|
49
34
|
chart.components.forEach(component => component.destroy())
|
|
50
35
|
chart.model.set({ destroyed: true }, { skipUpdate: true })
|
|
51
36
|
chart = undefined
|
|
@@ -1,37 +1,33 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SvelteComponentTyped } from 'svelte'
|
|
2
|
+
import type { Charts, ChartConfig, BaseChartOptions, ChartTabularData } from '@carbon/charts'
|
|
2
3
|
declare class __sveltets_Render<T extends BaseChartOptions> {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
bindings(): string;
|
|
24
|
-
exports(): {};
|
|
4
|
+
props(): {
|
|
5
|
+
[x: string]: any
|
|
6
|
+
data?: ChartTabularData | undefined
|
|
7
|
+
options?: T | undefined
|
|
8
|
+
Chart: new (holder: HTMLDivElement, chartConfigs: ChartConfig<T>) => Charts
|
|
9
|
+
chart: Charts | undefined
|
|
10
|
+
ref: HTMLDivElement | undefined
|
|
11
|
+
id?: string | undefined
|
|
12
|
+
}
|
|
13
|
+
events(): {
|
|
14
|
+
load: CustomEvent<null>
|
|
15
|
+
update: CustomEvent<{
|
|
16
|
+
data: ChartTabularData
|
|
17
|
+
options: T
|
|
18
|
+
}>
|
|
19
|
+
destroy: CustomEvent<null>
|
|
20
|
+
} & {
|
|
21
|
+
[evt: string]: CustomEvent<any>
|
|
22
|
+
}
|
|
23
|
+
slots(): {}
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
declare const BaseChart: $$IsomorphicComponent;
|
|
36
|
-
type BaseChart<T extends BaseChartOptions> = InstanceType<typeof BaseChart<T>>;
|
|
37
|
-
export default BaseChart;
|
|
25
|
+
export type BaseChartProps<T extends BaseChartOptions> = ReturnType<__sveltets_Render<T>['props']>
|
|
26
|
+
export type BaseChartEvents<T extends BaseChartOptions> = ReturnType<__sveltets_Render<T>['events']>
|
|
27
|
+
export type BaseChartSlots<T extends BaseChartOptions> = ReturnType<__sveltets_Render<T>['slots']>
|
|
28
|
+
export default class BaseChart<T extends BaseChartOptions> extends SvelteComponentTyped<
|
|
29
|
+
BaseChartProps<T>,
|
|
30
|
+
BaseChartEvents<T>,
|
|
31
|
+
BaseChartSlots<T>
|
|
32
|
+
> {}
|
|
33
|
+
export {}
|
package/dist/BoxplotChart.svelte
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
BoxplotChart as BoxplotChartCore,
|
|
4
|
-
type BoxplotChartOptions,
|
|
5
|
-
type ChartTabularData
|
|
6
|
-
} from '@carbon/charts'
|
|
1
|
+
<script>
|
|
2
|
+
import { BoxplotChart as BoxplotChartCore } from '@carbon/charts'
|
|
7
3
|
import BaseChart from './BaseChart.svelte'
|
|
8
|
-
|
|
9
|
-
export let
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
export let ref: HTMLDivElement | undefined = undefined
|
|
4
|
+
export let options
|
|
5
|
+
export let data
|
|
6
|
+
export let chart = undefined
|
|
7
|
+
export let ref = undefined
|
|
13
8
|
</script>
|
|
14
9
|
|
|
15
10
|
<BaseChart
|