@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.
Files changed (63) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +35 -54
  3. package/dist/AlluvialChart.svelte +16 -15
  4. package/dist/AlluvialChart.svelte.d.ts +9 -32
  5. package/dist/AreaChart.svelte +16 -15
  6. package/dist/AreaChart.svelte.d.ts +9 -32
  7. package/dist/BarChartGrouped.svelte +16 -15
  8. package/dist/BarChartGrouped.svelte.d.ts +9 -32
  9. package/dist/BarChartSimple.svelte +16 -15
  10. package/dist/BarChartSimple.svelte.d.ts +9 -32
  11. package/dist/BarChartStacked.svelte +16 -14
  12. package/dist/BarChartStacked.svelte.d.ts +9 -32
  13. package/dist/BaseChart.svelte +24 -39
  14. package/dist/BaseChart.svelte.d.ts +32 -34
  15. package/dist/BoxplotChart.svelte +16 -15
  16. package/dist/BoxplotChart.svelte.d.ts +9 -32
  17. package/dist/BubbleChart.svelte +16 -15
  18. package/dist/BubbleChart.svelte.d.ts +9 -32
  19. package/dist/BulletChart.svelte +16 -15
  20. package/dist/BulletChart.svelte.d.ts +9 -32
  21. package/dist/ChoroplethChart.svelte +16 -15
  22. package/dist/ChoroplethChart.svelte.d.ts +9 -32
  23. package/dist/CirclePackChart.svelte +16 -15
  24. package/dist/CirclePackChart.svelte.d.ts +9 -32
  25. package/dist/ComboChart.svelte +16 -15
  26. package/dist/ComboChart.svelte.d.ts +9 -32
  27. package/dist/DonutChart.svelte +16 -15
  28. package/dist/DonutChart.svelte.d.ts +9 -32
  29. package/dist/GaugeChart.svelte +16 -15
  30. package/dist/GaugeChart.svelte.d.ts +9 -32
  31. package/dist/HeatmapChart.svelte +16 -15
  32. package/dist/HeatmapChart.svelte.d.ts +9 -32
  33. package/dist/HistogramChart.svelte +16 -15
  34. package/dist/HistogramChart.svelte.d.ts +9 -32
  35. package/dist/LineChart.svelte +16 -15
  36. package/dist/LineChart.svelte.d.ts +9 -32
  37. package/dist/LollipopChart.svelte +16 -15
  38. package/dist/LollipopChart.svelte.d.ts +9 -32
  39. package/dist/MeterChart.svelte +16 -15
  40. package/dist/MeterChart.svelte.d.ts +9 -32
  41. package/dist/PieChart.svelte +16 -15
  42. package/dist/PieChart.svelte.d.ts +9 -32
  43. package/dist/RadarChart.svelte +16 -15
  44. package/dist/RadarChart.svelte.d.ts +9 -32
  45. package/dist/ScatterChart.svelte +16 -15
  46. package/dist/ScatterChart.svelte.d.ts +9 -32
  47. package/dist/StackedAreaChart.svelte +16 -15
  48. package/dist/StackedAreaChart.svelte.d.ts +12 -32
  49. package/dist/TreeChart.svelte +16 -15
  50. package/dist/TreeChart.svelte.d.ts +9 -32
  51. package/dist/TreemapChart.svelte +16 -15
  52. package/dist/TreemapChart.svelte.d.ts +9 -32
  53. package/dist/WordCloudChart.svelte +16 -16
  54. package/dist/WordCloudChart.svelte.d.ts +9 -32
  55. package/dist/index.d.ts +141 -36
  56. package/dist/index.js +109 -31
  57. package/dist/interfaces.d.ts +24 -0
  58. package/dist/interfaces.js +1 -0
  59. package/dist/styles.css +4656 -4357
  60. package/dist/styles.css.map +1 -1
  61. package/dist/styles.min.css +7097 -1
  62. package/dist/styles.min.css.map +1 -1
  63. package/package.json +16 -12
@@ -1,56 +1,41 @@
1
- <script lang="ts" generics="T extends BaseChartOptions">
2
- /* eslint-disable @typescript-eslint/no-unused-vars */
3
- 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
- const chartHolderCssClass = 'cds--chart-holder' // Used by Carbon Charts CSS
15
- export let data: ChartTabularData = [] // Chart data, default is empty
16
- export let options: T = {} as T // Specific chart option type, default is empty
17
- export let Chart: CoreChartClass // Used to instantiate next property
18
- export let chart: Charts | undefined // Instance of the chart class
19
- export let ref: HTMLDivElement | undefined // Binding to chart 'holder' in template below
20
- export let id = `chart-${Math.random().toString(36)}` // id for chart holder element
21
-
22
- const dispatch = createEventDispatcher<DispatchedEvents>()
23
-
1
+ <script>
2
+ import { onMount, onDestroy } from 'svelte'
3
+ const chartHolderCssClass = 'cds--chart-holder'
4
+ let {
5
+ id = `chart-${Math.random().toString(36)}`,
6
+ data = [],
7
+ options = {},
8
+ ref = $bindable(),
9
+ chart = $bindable(),
10
+ Chart,
11
+ onload,
12
+ onupdate,
13
+ ondestroy,
14
+ ...rest
15
+ } = $props()
24
16
  onMount(() => {
25
17
  try {
26
- chart = new Chart(ref as HTMLDivElement, { data, options })
27
- dispatch('load')
18
+ chart = new Chart(ref, { data, options })
19
+ onload?.()
28
20
  } catch (error) {
29
21
  console.error('Failed to initialize chart:', error)
30
22
  }
31
23
  })
32
-
33
- afterUpdate(() => {
24
+ $effect(() => {
34
25
  if (chart) {
35
- try {
36
- chart.model.setData(data)
37
- chart.model.setOptions(options)
38
- dispatch('update', { data, options })
39
- } catch (error) {
40
- console.error('Failed to update chart:', error)
41
- }
26
+ chart.model.setData(data)
27
+ chart.model.setOptions(options)
28
+ onupdate?.({ data, options })
42
29
  }
43
30
  })
44
-
45
31
  onDestroy(() => {
46
32
  if (chart) {
47
- dispatch('destroy')
48
- // Like core's Chart.destroy() but keeps div chart holder bound to ref as it's part of the template below
49
33
  chart.components.forEach(component => component.destroy())
50
34
  chart.model.set({ destroyed: true }, { skipUpdate: true })
51
- chart = undefined
35
+ chart = void 0
36
+ ondestroy?.()
52
37
  }
53
38
  })
54
39
  </script>
55
40
 
56
- <div {id} bind:this={ref} class={chartHolderCssClass} {...$$restProps}></div>
41
+ <div {id} bind:this={ref} class={chartHolderCssClass} {...rest}></div>
@@ -1,37 +1,35 @@
1
- import type { Charts, ChartConfig, BaseChartOptions, ChartTabularData } from '@carbon/charts';
2
- declare class __sveltets_Render<T extends BaseChartOptions> {
3
- props(): {
4
- [x: string]: any;
5
- data?: ChartTabularData | undefined;
6
- options?: T | undefined;
7
- Chart: new (holder: HTMLDivElement, chartConfigs: ChartConfig<T>) => Charts;
8
- chart: Charts | undefined;
9
- ref: HTMLDivElement | undefined;
10
- id?: string | undefined;
11
- };
12
- events(): {
13
- load: CustomEvent<null>;
14
- update: CustomEvent<{
15
- data: ChartTabularData;
16
- options: T;
17
- }>;
18
- destroy: CustomEvent<null>;
19
- } & {
20
- [evt: string]: CustomEvent<any>;
21
- };
22
- slots(): {};
23
- bindings(): string;
24
- exports(): {};
1
+ import type { Charts, BaseChartOptions } from '@carbon/charts'
2
+ import type { BaseChartProps } from './interfaces'
3
+ declare class __sveltets_Render<
4
+ ChartType extends Charts,
5
+ ChartOptionType extends BaseChartOptions
6
+ > {
7
+ props(): BaseChartProps<ChartType, ChartOptionType>
8
+ events(): {}
9
+ slots(): {}
10
+ bindings(): 'ref' | 'chart'
11
+ exports(): {}
25
12
  }
26
13
  interface $$IsomorphicComponent {
27
- new <T extends BaseChartOptions>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
28
- $$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
29
- } & ReturnType<__sveltets_Render<T>['exports']>;
30
- <T extends BaseChartOptions>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {
31
- $$events?: ReturnType<__sveltets_Render<T>['events']>;
32
- }): ReturnType<__sveltets_Render<T>['exports']>;
33
- z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
14
+ new <ChartType extends Charts, ChartOptionType extends BaseChartOptions>(
15
+ options: import('svelte').ComponentConstructorOptions<
16
+ ReturnType<__sveltets_Render<ChartType, ChartOptionType>['props']>
17
+ >
18
+ ): import('svelte').SvelteComponent<
19
+ ReturnType<__sveltets_Render<ChartType, ChartOptionType>['props']>,
20
+ ReturnType<__sveltets_Render<ChartType, ChartOptionType>['events']>,
21
+ ReturnType<__sveltets_Render<ChartType, ChartOptionType>['slots']>
22
+ > & {
23
+ $$bindings?: ReturnType<__sveltets_Render<ChartType, ChartOptionType>['bindings']>
24
+ } & ReturnType<__sveltets_Render<ChartType, ChartOptionType>['exports']>
25
+ <ChartType extends Charts, ChartOptionType extends BaseChartOptions>(
26
+ internal: unknown,
27
+ props: ReturnType<__sveltets_Render<ChartType, ChartOptionType>['props']> & {}
28
+ ): ReturnType<__sveltets_Render<ChartType, ChartOptionType>['exports']>
29
+ z_$$bindings?: ReturnType<__sveltets_Render<any, any>['bindings']>
34
30
  }
35
- declare const BaseChart: $$IsomorphicComponent;
36
- type BaseChart<T extends BaseChartOptions> = InstanceType<typeof BaseChart<T>>;
37
- export default BaseChart;
31
+ declare const BaseChart: $$IsomorphicComponent
32
+ type BaseChart<ChartType extends Charts, ChartOptionType extends BaseChartOptions> = InstanceType<
33
+ typeof BaseChart<ChartType, ChartOptionType>
34
+ >
35
+ export default BaseChart
@@ -1,24 +1,25 @@
1
- <script lang="ts">
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 options: BoxplotChartOptions
10
- export let data: ChartTabularData
11
- export let chart: BoxplotChartCore | undefined = undefined
12
- export let ref: HTMLDivElement | undefined = undefined
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={BoxplotChartCore}
18
18
  {options}
19
19
  {data}
20
20
  bind:ref
21
21
  bind:chart
22
- on:load
23
- on:update
24
- on:destroy />
22
+ {onload}
23
+ {onupdate}
24
+ {ondestroy}
25
+ {...rest} />
@@ -1,32 +1,9 @@
1
- import { BoxplotChart as BoxplotChartCore, type BoxplotChartOptions, type ChartTabularData } from '@carbon/charts';
2
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
- $$bindings?: Bindings;
5
- } & Exports;
6
- (internal: unknown, props: Props & {
7
- $$events?: Events;
8
- $$slots?: Slots;
9
- }): Exports & {
10
- $set?: any;
11
- $on?: any;
12
- };
13
- z_$$bindings?: Bindings;
14
- }
15
- declare const BoxplotChart: $$__sveltets_2_IsomorphicComponent<{
16
- [x: string]: any;
17
- options: BoxplotChartOptions;
18
- data: ChartTabularData;
19
- chart?: BoxplotChartCore | 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 BoxplotChart = InstanceType<typeof BoxplotChart>;
32
- export default BoxplotChart;
1
+ import { BoxplotChart as BoxplotChartCore } from '@carbon/charts'
2
+ import type { ChartProps } from './interfaces'
3
+ declare const BoxplotChart: import('svelte').Component<
4
+ ChartProps<BoxplotChartCore, import('@carbon/charts').AxisChartOptions>,
5
+ {},
6
+ 'ref' | 'chart'
7
+ >
8
+ type BoxplotChart = ReturnType<typeof BoxplotChart>
9
+ export default BoxplotChart
@@ -1,24 +1,25 @@
1
- <script lang="ts">
2
- import {
3
- BubbleChart as BubbleChartCore,
4
- type BubbleChartOptions,
5
- type ChartTabularData
6
- } from '@carbon/charts'
1
+ <script>
2
+ import { BubbleChart as BubbleChartCore } from '@carbon/charts'
7
3
  import BaseChart from './BaseChart.svelte'
8
-
9
- export let options: BubbleChartOptions
10
- export let data: ChartTabularData
11
- export let chart: BubbleChartCore | undefined = undefined
12
- export let ref: HTMLDivElement | undefined = undefined
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={BubbleChartCore}
18
18
  {options}
19
19
  {data}
20
20
  bind:ref
21
21
  bind:chart
22
- on:load
23
- on:update
24
- on:destroy />
22
+ {onload}
23
+ {onupdate}
24
+ {ondestroy}
25
+ {...rest} />
@@ -1,32 +1,9 @@
1
- import { BubbleChart as BubbleChartCore, type BubbleChartOptions, type ChartTabularData } from '@carbon/charts';
2
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
- $$bindings?: Bindings;
5
- } & Exports;
6
- (internal: unknown, props: Props & {
7
- $$events?: Events;
8
- $$slots?: Slots;
9
- }): Exports & {
10
- $set?: any;
11
- $on?: any;
12
- };
13
- z_$$bindings?: Bindings;
14
- }
15
- declare const BubbleChart: $$__sveltets_2_IsomorphicComponent<{
16
- [x: string]: any;
17
- options: BubbleChartOptions;
18
- data: ChartTabularData;
19
- chart?: BubbleChartCore | 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 BubbleChart = InstanceType<typeof BubbleChart>;
32
- export default BubbleChart;
1
+ import { BubbleChart as BubbleChartCore, type BubbleChartOptions } from '@carbon/charts'
2
+ import type { ChartProps } from './interfaces'
3
+ declare const BubbleChart: import('svelte').Component<
4
+ ChartProps<BubbleChartCore, BubbleChartOptions>,
5
+ {},
6
+ 'ref' | 'chart'
7
+ >
8
+ type BubbleChart = ReturnType<typeof BubbleChart>
9
+ export default BubbleChart
@@ -1,24 +1,25 @@
1
- <script lang="ts">
2
- import {
3
- BulletChart as BulletChartCore,
4
- type BulletChartOptions,
5
- type ChartTabularData
6
- } from '@carbon/charts'
1
+ <script>
2
+ import { BulletChart as BulletChartCore } from '@carbon/charts'
7
3
  import BaseChart from './BaseChart.svelte'
8
-
9
- export let options: BulletChartOptions
10
- export let data: ChartTabularData
11
- export let chart: BulletChartCore | undefined = undefined
12
- export let ref: HTMLDivElement | undefined = undefined
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={BulletChartCore}
18
18
  {options}
19
19
  {data}
20
20
  bind:ref
21
21
  bind:chart
22
- on:load
23
- on:update
24
- on:destroy />
22
+ {onload}
23
+ {onupdate}
24
+ {ondestroy}
25
+ {...rest} />
@@ -1,32 +1,9 @@
1
- import { BulletChart as BulletChartCore, type BulletChartOptions, type ChartTabularData } from '@carbon/charts';
2
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
- $$bindings?: Bindings;
5
- } & Exports;
6
- (internal: unknown, props: Props & {
7
- $$events?: Events;
8
- $$slots?: Slots;
9
- }): Exports & {
10
- $set?: any;
11
- $on?: any;
12
- };
13
- z_$$bindings?: Bindings;
14
- }
15
- declare const BulletChart: $$__sveltets_2_IsomorphicComponent<{
16
- [x: string]: any;
17
- options: BulletChartOptions;
18
- data: ChartTabularData;
19
- chart?: BulletChartCore | 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 BulletChart = InstanceType<typeof BulletChart>;
32
- export default BulletChart;
1
+ import { BulletChart as BulletChartCore, type BulletChartOptions } from '@carbon/charts'
2
+ import type { ChartProps } from './interfaces'
3
+ declare const BulletChart: import('svelte').Component<
4
+ ChartProps<BulletChartCore, BulletChartOptions>,
5
+ {},
6
+ 'ref' | 'chart'
7
+ >
8
+ type BulletChart = ReturnType<typeof BulletChart>
9
+ export default BulletChart
@@ -1,24 +1,25 @@
1
- <script lang="ts">
2
- import {
3
- ChoroplethChart as ChoroplethChartCore,
4
- type ChoroplethChartOptions,
5
- type ChartTabularData
6
- } from '@carbon/charts'
1
+ <script>
2
+ import { ChoroplethChart as ChoroplethChartCore } from '@carbon/charts'
7
3
  import BaseChart from './BaseChart.svelte'
8
-
9
- export let options: ChoroplethChartOptions
10
- export let data: ChartTabularData
11
- export let chart: ChoroplethChartCore | undefined = undefined
12
- export let ref: HTMLDivElement | undefined = undefined
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={ChoroplethChartCore}
18
18
  {options}
19
19
  {data}
20
20
  bind:ref
21
21
  bind:chart
22
- on:load
23
- on:update
24
- on:destroy />
22
+ {onload}
23
+ {onupdate}
24
+ {ondestroy}
25
+ {...rest} />
@@ -1,32 +1,9 @@
1
- import { ChoroplethChart as ChoroplethChartCore, type ChoroplethChartOptions, type ChartTabularData } from '@carbon/charts';
2
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
- $$bindings?: Bindings;
5
- } & Exports;
6
- (internal: unknown, props: Props & {
7
- $$events?: Events;
8
- $$slots?: Slots;
9
- }): Exports & {
10
- $set?: any;
11
- $on?: any;
12
- };
13
- z_$$bindings?: Bindings;
14
- }
15
- declare const ChoroplethChart: $$__sveltets_2_IsomorphicComponent<{
16
- [x: string]: any;
17
- options: ChoroplethChartOptions;
18
- data: ChartTabularData;
19
- chart?: ChoroplethChartCore | 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 ChoroplethChart = InstanceType<typeof ChoroplethChart>;
32
- export default ChoroplethChart;
1
+ import { ChoroplethChart as ChoroplethChartCore, type ChoroplethChartOptions } from '@carbon/charts'
2
+ import type { ChartProps } from './interfaces'
3
+ declare const ChoroplethChart: import('svelte').Component<
4
+ ChartProps<ChoroplethChartCore, ChoroplethChartOptions>,
5
+ {},
6
+ 'ref' | 'chart'
7
+ >
8
+ type ChoroplethChart = ReturnType<typeof ChoroplethChart>
9
+ export default ChoroplethChart
@@ -1,24 +1,25 @@
1
- <script lang="ts">
2
- import {
3
- CirclePackChart as CirclePackChartCore,
4
- type CirclePackChartOptions,
5
- type ChartTabularData
6
- } from '@carbon/charts'
1
+ <script>
2
+ import { CirclePackChart as CirclePackChartCore } from '@carbon/charts'
7
3
  import BaseChart from './BaseChart.svelte'
8
-
9
- export let options: CirclePackChartOptions
10
- export let data: ChartTabularData
11
- export let chart: CirclePackChartCore | undefined = undefined
12
- export let ref: HTMLDivElement | undefined = undefined
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={CirclePackChartCore}
18
18
  {options}
19
19
  {data}
20
20
  bind:ref
21
21
  bind:chart
22
- on:load
23
- on:update
24
- on:destroy />
22
+ {onload}
23
+ {onupdate}
24
+ {ondestroy}
25
+ {...rest} />
@@ -1,32 +1,9 @@
1
- import { CirclePackChart as CirclePackChartCore, type CirclePackChartOptions, type ChartTabularData } from '@carbon/charts';
2
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
- $$bindings?: Bindings;
5
- } & Exports;
6
- (internal: unknown, props: Props & {
7
- $$events?: Events;
8
- $$slots?: Slots;
9
- }): Exports & {
10
- $set?: any;
11
- $on?: any;
12
- };
13
- z_$$bindings?: Bindings;
14
- }
15
- declare const CirclePackChart: $$__sveltets_2_IsomorphicComponent<{
16
- [x: string]: any;
17
- options: CirclePackChartOptions;
18
- data: ChartTabularData;
19
- chart?: CirclePackChartCore | 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 CirclePackChart = InstanceType<typeof CirclePackChart>;
32
- export default CirclePackChart;
1
+ import { CirclePackChart as CirclePackChartCore, type CirclePackChartOptions } from '@carbon/charts'
2
+ import type { ChartProps } from './interfaces'
3
+ declare const CirclePackChart: import('svelte').Component<
4
+ ChartProps<CirclePackChartCore, CirclePackChartOptions>,
5
+ {},
6
+ 'ref' | 'chart'
7
+ >
8
+ type CirclePackChart = ReturnType<typeof CirclePackChart>
9
+ export default CirclePackChart
@@ -1,24 +1,25 @@
1
- <script lang="ts">
2
- import {
3
- ComboChart as ComboChartCore,
4
- type ComboChartOptions,
5
- type ChartTabularData
6
- } from '@carbon/charts'
1
+ <script>
2
+ import { ComboChart as ComboChartCore } from '@carbon/charts'
7
3
  import BaseChart from './BaseChart.svelte'
8
-
9
- export let options: ComboChartOptions
10
- export let data: ChartTabularData
11
- export let chart: ComboChartCore | undefined = undefined
12
- export let ref: HTMLDivElement | undefined = undefined
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={ComboChartCore}
18
18
  {options}
19
19
  {data}
20
20
  bind:ref
21
21
  bind:chart
22
- on:load
23
- on:update
24
- on:destroy />
22
+ {onload}
23
+ {onupdate}
24
+ {ondestroy}
25
+ {...rest} />
@@ -1,32 +1,9 @@
1
- import { ComboChart as ComboChartCore, type ComboChartOptions, type ChartTabularData } from '@carbon/charts';
2
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
- $$bindings?: Bindings;
5
- } & Exports;
6
- (internal: unknown, props: Props & {
7
- $$events?: Events;
8
- $$slots?: Slots;
9
- }): Exports & {
10
- $set?: any;
11
- $on?: any;
12
- };
13
- z_$$bindings?: Bindings;
14
- }
15
- declare const ComboChart: $$__sveltets_2_IsomorphicComponent<{
16
- [x: string]: any;
17
- options: ComboChartOptions;
18
- data: ChartTabularData;
19
- chart?: ComboChartCore | 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 ComboChart = InstanceType<typeof ComboChart>;
32
- export default ComboChart;
1
+ import { ComboChart as ComboChartCore, type ComboChartOptions } from '@carbon/charts'
2
+ import type { ChartProps } from './interfaces'
3
+ declare const ComboChart: import('svelte').Component<
4
+ ChartProps<ComboChartCore, ComboChartOptions>,
5
+ {},
6
+ 'ref' | 'chart'
7
+ >
8
+ type ComboChart = ReturnType<typeof ComboChart>
9
+ export default ComboChart