-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: rename components Base -> Chart, Polar -> PolarArea (#64)
- Loading branch information
Showing
22 changed files
with
93 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<script> | ||
import { | ||
Base as Chart, | ||
Chart, | ||
getDatasetAtEvent, | ||
getElementAtEvent, | ||
getElementsAtEvent, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
CategoryScale, | ||
LinearScale, | ||
PointElement, | ||
Plugin, | ||
} from 'chart.js'; | ||
ChartJS.register( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<script lang="ts"> | ||
import type { DefaultDataPoint } from 'chart.js'; | ||
import { Chart as ChartJS, BarController } from 'chart.js'; | ||
import type { ChartProps } from './types'; | ||
import Base from './Base.svelte'; | ||
import type { ChartBaseProps } from './types'; | ||
import Chart from './Chart.svelte'; | ||
import { useForwardEvents } from './utils'; | ||
interface $$Props<TData = DefaultDataPoint<'bar'>, TLabel = unknown> | ||
extends Omit<ChartProps<'bar', TData, TLabel>, 'type'> { | ||
extends Omit<ChartBaseProps<'bar', TData, TLabel>, 'type'> { | ||
chart: ChartJS<'bar', TData, TLabel> | null; | ||
} | ||
ChartJS.register(BarController); | ||
export let chart: $$Props['chart'] = null; | ||
let props = $$props as $$Props; | ||
let baseRef: Base; | ||
let baseChartRef: Chart; | ||
useForwardEvents(() => baseRef); | ||
useForwardEvents(() => baseChartRef); | ||
</script> | ||
|
||
<Base bind:this={baseRef} bind:chart type="bar" {...props} /> | ||
<Chart bind:this={baseChartRef} bind:chart type="bar" {...props} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<script lang="ts"> | ||
import type { DefaultDataPoint } from 'chart.js'; | ||
import { Chart as ChartJS, BubbleController } from 'chart.js'; | ||
import type { ChartProps } from './types'; | ||
import Base from './Base.svelte'; | ||
import type { ChartBaseProps } from './types'; | ||
import Chart from './Chart.svelte'; | ||
import { useForwardEvents } from './utils'; | ||
interface $$Props<TData = DefaultDataPoint<'bubble'>, TLabel = unknown> | ||
extends Omit<ChartProps<'bubble', TData, TLabel>, 'type'> { | ||
extends Omit<ChartBaseProps<'bubble', TData, TLabel>, 'type'> { | ||
chart: ChartJS<'bubble', TData, TLabel> | null; | ||
} | ||
ChartJS.register(BubbleController); | ||
export let chart: $$Props['chart'] = null; | ||
let props = $$props as $$Props; | ||
let baseRef: Base; | ||
let baseChartRef: Chart; | ||
useForwardEvents(() => baseRef); | ||
useForwardEvents(() => baseChartRef); | ||
</script> | ||
|
||
<Base bind:this={baseRef} bind:chart type="bubble" {...props} /> | ||
<Chart bind:this={baseChartRef} bind:chart type="bubble" {...props} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<script lang="ts"> | ||
import type { DefaultDataPoint } from 'chart.js'; | ||
import { Chart as ChartJS, DoughnutController } from 'chart.js'; | ||
import type { ChartProps } from './types'; | ||
import Base from './Base.svelte'; | ||
import type { ChartBaseProps } from './types'; | ||
import Chart from './Chart.svelte'; | ||
import { useForwardEvents } from './utils'; | ||
interface $$Props<TData = DefaultDataPoint<'doughnut'>, TLabel = unknown> | ||
extends Omit<ChartProps<'doughnut', TData, TLabel>, 'type'> { | ||
extends Omit<ChartBaseProps<'doughnut', TData, TLabel>, 'type'> { | ||
chart: ChartJS<'doughnut', TData, TLabel> | null; | ||
} | ||
ChartJS.register(DoughnutController); | ||
export let chart: $$Props['chart'] = null; | ||
let props = $$props as $$Props; | ||
let baseRef: Base; | ||
let baseChartRef: Chart; | ||
useForwardEvents(() => baseRef); | ||
useForwardEvents(() => baseChartRef); | ||
</script> | ||
|
||
<Base bind:this={baseRef} bind:chart type="doughnut" {...props} /> | ||
<Chart bind:this={baseChartRef} bind:chart type="doughnut" {...props} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<script lang="ts"> | ||
import type { DefaultDataPoint } from 'chart.js'; | ||
import { Chart as ChartJS, LineController } from 'chart.js'; | ||
import type { ChartProps } from './types'; | ||
import Base from './Base.svelte'; | ||
import type { ChartBaseProps } from './types'; | ||
import Chart from './Chart.svelte'; | ||
import { useForwardEvents } from './utils'; | ||
interface $$Props<TData = DefaultDataPoint<'line'>, TLabel = unknown> | ||
extends Omit<ChartProps<'line', TData, TLabel>, 'type'> { | ||
extends Omit<ChartBaseProps<'line', TData, TLabel>, 'type'> { | ||
chart: ChartJS<'line', TData, TLabel> | null; | ||
} | ||
ChartJS.register(LineController); | ||
export let chart: $$Props['chart'] = null; | ||
let props = $$props as $$Props; | ||
let baseRef: Base; | ||
let baseChartRef: Chart; | ||
useForwardEvents(() => baseRef); | ||
useForwardEvents(() => baseChartRef); | ||
</script> | ||
|
||
<Base bind:this={baseRef} bind:chart type="line" {...props} /> | ||
<Chart bind:this={baseChartRef} bind:chart type="line" {...props} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<script lang="ts"> | ||
import type { DefaultDataPoint } from 'chart.js'; | ||
import { Chart as ChartJS, PieController } from 'chart.js'; | ||
import type { ChartProps } from './types'; | ||
import Base from './Base.svelte'; | ||
import type { ChartBaseProps } from './types'; | ||
import Chart from './Chart.svelte'; | ||
import { useForwardEvents } from './utils'; | ||
interface $$Props<TData = DefaultDataPoint<'pie'>, TLabel = unknown> | ||
extends Omit<ChartProps<'pie', TData, TLabel>, 'type'> { | ||
extends Omit<ChartBaseProps<'pie', TData, TLabel>, 'type'> { | ||
chart: ChartJS<'pie', TData, TLabel> | null; | ||
} | ||
ChartJS.register(PieController); | ||
export let chart: $$Props['chart'] = null; | ||
let props = $$props as $$Props; | ||
let baseRef: Base; | ||
let baseChartRef: Chart; | ||
useForwardEvents(() => baseRef); | ||
useForwardEvents(() => baseChartRef); | ||
</script> | ||
|
||
<Base bind:this={baseRef} bind:chart type="pie" {...props} /> | ||
<Chart bind:this={baseChartRef} bind:chart type="pie" {...props} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<script lang="ts"> | ||
import type { DefaultDataPoint } from 'chart.js'; | ||
import { Chart as ChartJS, PolarAreaController } from 'chart.js'; | ||
import type { ChartProps } from './types'; | ||
import Base from './Base.svelte'; | ||
import type { ChartBaseProps } from './types'; | ||
import Chart from './Chart.svelte'; | ||
import { useForwardEvents } from './utils'; | ||
interface $$Props<TData = DefaultDataPoint<'polarArea'>, TLabel = unknown> | ||
extends Omit<ChartProps<'polarArea', TData, TLabel>, 'type'> { | ||
extends Omit<ChartBaseProps<'polarArea', TData, TLabel>, 'type'> { | ||
chart: ChartJS<'polarArea', TData, TLabel> | null; | ||
} | ||
ChartJS.register(PolarAreaController); | ||
export let chart: $$Props['chart'] = null; | ||
let props = $$props as $$Props; | ||
let baseRef: Base; | ||
let baseChartRef: Chart; | ||
useForwardEvents(() => baseRef); | ||
useForwardEvents(() => baseChartRef); | ||
</script> | ||
|
||
<Base bind:this={baseRef} bind:chart type="polarArea" {...props} /> | ||
<Chart bind:this={baseChartRef} bind:chart type="polarArea" {...props} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<script lang="ts"> | ||
import type { DefaultDataPoint } from 'chart.js'; | ||
import { Chart as ChartJS, RadarController } from 'chart.js'; | ||
import type { ChartProps } from './types'; | ||
import Base from './Base.svelte'; | ||
import type { ChartBaseProps } from './types'; | ||
import Chart from './Chart.svelte'; | ||
import { useForwardEvents } from './utils'; | ||
interface $$Props<TData = DefaultDataPoint<'radar'>, TLabel = unknown> | ||
extends Omit<ChartProps<'radar', TData, TLabel>, 'type'> { | ||
extends Omit<ChartBaseProps<'radar', TData, TLabel>, 'type'> { | ||
chart: ChartJS<'radar', TData, TLabel> | null; | ||
} | ||
ChartJS.register(RadarController); | ||
export let chart: $$Props['chart'] = null; | ||
let props = $$props as $$Props; | ||
let baseRef: Base; | ||
let baseChartRef: Chart; | ||
useForwardEvents(() => baseRef); | ||
useForwardEvents(() => baseChartRef); | ||
</script> | ||
|
||
<Base bind:this={baseRef} bind:chart type="radar" {...props} /> | ||
<Chart bind:this={baseChartRef} bind:chart type="radar" {...props} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<script lang="ts"> | ||
import type { DefaultDataPoint } from 'chart.js'; | ||
import { Chart as ChartJS, ScatterController } from 'chart.js'; | ||
import type { ChartProps } from './types'; | ||
import Base from './Base.svelte'; | ||
import type { ChartBaseProps } from './types'; | ||
import Chart from './Chart.svelte'; | ||
import { useForwardEvents } from './utils'; | ||
interface $$Props<TData = DefaultDataPoint<'scatter'>, TLabel = unknown> | ||
extends Omit<ChartProps<'scatter', TData, TLabel>, 'type'> { | ||
extends Omit<ChartBaseProps<'scatter', TData, TLabel>, 'type'> { | ||
chart: ChartJS<'scatter', TData, TLabel> | null; | ||
} | ||
ChartJS.register(ScatterController); | ||
export let chart: $$Props['chart'] = null; | ||
let props = $$props as $$Props; | ||
let baseRef: Base; | ||
let baseChartRef: Chart; | ||
useForwardEvents(() => baseRef); | ||
useForwardEvents(() => baseChartRef); | ||
</script> | ||
|
||
<Base bind:this={baseRef} bind:chart type="scatter" {...props} /> | ||
<Chart bind:this={baseChartRef} bind:chart type="scatter" {...props} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,36 @@ | ||
import Chart from './Chart.svelte'; | ||
import Line from './Line.svelte'; | ||
import Radar from './Radar.svelte'; | ||
import Doughnut from './Doughnut.svelte'; | ||
import Pie from './Pie.svelte'; | ||
import Bar from './Bar.svelte'; | ||
import Polar from './Polar.svelte'; | ||
import PolarArea from './PolarArea.svelte'; | ||
import Bubble from './Bubble.svelte'; | ||
import Scatter from './Scatter.svelte'; | ||
import Base from './Base.svelte'; | ||
|
||
/** | ||
* @deprecated Please use `Chart` name instead. | ||
* @todo Remove in v3.0.0 | ||
*/ | ||
const Base = Chart; | ||
/** | ||
* @deprecated Please use `PolarArea` name instead. | ||
* @todo Remove in v3.0.0 | ||
*/ | ||
const Polar = PolarArea; | ||
|
||
export * from './types'; | ||
export * from './utils'; | ||
export { Base, Line, Radar, Doughnut, Pie, Bar, Scatter, Bubble, Polar }; | ||
export { | ||
Chart, | ||
Base, | ||
Line, | ||
Radar, | ||
Doughnut, | ||
Pie, | ||
Bar, | ||
Scatter, | ||
Bubble, | ||
PolarArea, | ||
Polar, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.