Skip to content

Commit

Permalink
release - feat(svelte): add TypeScript definitions for BoxplotChart, …
Browse files Browse the repository at this point in the history
…WordCloudChart carbon-design-system#963 (carbon-design-system#1003)

Closes carbon-design-system#963

Co-authored-by: natashadecoste <natasha.decoste@gmail.com>
  • Loading branch information
metonym and natashadecoste authored Apr 27, 2021
1 parent 2affd4b commit 83efddd
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 0 deletions.
44 changes: 44 additions & 0 deletions packages/svelte/tests/BoxplotChart.test.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<script lang="ts">
import { BoxplotChart } from '../types';
import type { BoxplotChart as BC } from '@carbon/charts';
import {
simpleBoxplotData as data,
simpleBoxplotOptions,
} from '@carbon/charts/demo/data';
let chart: BC = null;
let ref = null;
const options = simpleBoxplotOptions as any;
</script>

<BoxplotChart
bind:chart
bind:ref
on:load={(e) => {
console.log(e.detail);
}}
on:update={(e) => {
console.log(e.detail);
}}
on:destroy={(e) => {
console.log(e.detail);
}}
{data}
{options}
/>

<svelte:component
this={BoxplotChart}
on:load={(e) => {
console.log(e.detail);
}}
on:update={(e) => {
console.log(e.detail);
}}
on:destroy={(e) => {
console.log(e.detail);
}}
{data}
{options}
/>
44 changes: 44 additions & 0 deletions packages/svelte/tests/WordCloudChart.test.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<script lang="ts">
import { WordCloudChart } from '../types';
import type { WordCloudChart as WC } from '@carbon/charts';
import {
wordCloudData as data,
wordCloudOptions,
} from '@carbon/charts/demo/data';
let chart: WC = null;
let ref = null;
const options = wordCloudOptions as any;
</script>

<WordCloudChart
bind:chart
bind:ref
on:load={(e) => {
console.log(e.detail);
}}
on:update={(e) => {
console.log(e.detail);
}}
on:destroy={(e) => {
console.log(e.detail);
}}
{data}
{options}
/>

<svelte:component
this={WordCloudChart}
on:load={(e) => {
console.log(e.detail);
}}
on:update={(e) => {
console.log(e.detail);
}}
on:destroy={(e) => {
console.log(e.detail);
}}
{data}
{options}
/>
5 changes: 5 additions & 0 deletions packages/svelte/types/BoxplotChart.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BoxplotChart as BC } from "@carbon/charts";
import type { BoxplotChartOptions } from "@carbon/charts/interfaces";
import BaseChart from "./BaseChart";

export default class BoxplotChart extends BaseChart<BC, BoxplotChartOptions> {}
5 changes: 5 additions & 0 deletions packages/svelte/types/WordCloudChart.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WordCloudChart as WC } from "@carbon/charts";
import type { WorldCloudChartOptions } from "@carbon/charts/interfaces";
import BaseChart from "./BaseChart";

export default class WordCloudChart extends BaseChart<WC, WorldCloudChartOptions> {}
2 changes: 2 additions & 0 deletions packages/svelte/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export { default as StackedAreaChart } from "./StackedAreaChart";
export { default as BarChartGrouped } from "./BarChartGrouped";
export { default as BarChartSimple } from "./BarChartSimple";
export { default as BarChartStacked } from "./BarChartStacked";
export { default as BoxplotChart } from "./BoxplotChart";
export { default as BubbleChart } from "./BubbleChart";
export { default as ComboChart } from "./ComboChart";
export { default as DonutChart } from "./DonutChart";
Expand All @@ -14,3 +15,4 @@ export { default as RadarChart } from "./RadarChart";
export { default as GaugeChart } from "./GaugeChart";
export { default as MeterChart } from "./MeterChart";
export { default as TreemapChart } from "./TreemapChart";
export { default as WordCloudChart } from "./WordCloudChart";

0 comments on commit 83efddd

Please sign in to comment.