Skip to content

Commit

Permalink
fix: type error & gauge theme
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoluoHe committed May 30, 2024
1 parent d886718 commit 4e9dd92
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IComponentTheme } from '@visactor/vchart-types';
import type { IComponentTheme } from '@visactor/vchart';

export const axis: Pick<
IComponentTheme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const indicator: IIndicatorTheme = {
visible: true,
style: {
fill: '#85878A',
// fill: { type: 'palette', key: 'blackColors65' },
fontWeight: 400,
fontSize: 12
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import type { IMarkPointTheme } from '@visactor/vchart';

export const markPoint: IMarkPointTheme = {
itemContent: {
autoRotate: false,
// @ts-ignore
autoRotate: false, // FIXME: type error
offsetY: -16,
text: {
style: {
Expand Down
9 changes: 6 additions & 3 deletions packages/vchart-theme/src/chart-hub/common/series/bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import type { ISeriesTheme, SeriesTypeEnum, SeriesTypeForThemeEnum } from '@visa

const bar: ISeriesTheme['bar'] = {
barWidth: 8,
barGapInGroup: 4,
// @ts-ignore
barGapInGroup: 4, // FIXME: typeError
label: {
style: {
fill: { type: 'palette', key: 'secondaryFontColor' }
Expand All @@ -11,15 +12,17 @@ const bar: ISeriesTheme['bar'] = {
};

const bar_horizontal: ISeriesTheme['bar'] = {
stackCornerRadius: [0, 1, 1, 0],
// @ts-ignore
stackCornerRadius: [0, 1, 1, 0], // FIXME: typeError
label: {
position: 'right',
offset: 4
}
};

const bar_vertical: ISeriesTheme['bar'] = {
stackCornerRadius: [1, 1, 0, 0],
// @ts-ignore
stackCornerRadius: [1, 1, 0, 0], // FIXME: typeError
label: {
position: 'top',
offset: 4
Expand Down
24 changes: 15 additions & 9 deletions packages/vchart-theme/src/chart-hub/common/series/gauge.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import type { ISeriesTheme } from '@visactor/vchart';

export const gauge: ISeriesTheme = {
gauge: {
// FIXME: 不生效
outerRadius: 0.8,
innerRadius: 0.6,
// FIXME: 不生效
segment: {
circularProgress: {
// FIXME: not work
// radius: 1,
// innerRadius: 0.1,
progress: {
style: {
fill: 'red',
fillOpacity: 1,
cornerRadius: 100
cornerRadius: 100,
fill: { type: 'palette', key: 'bandColor' }
}
},
track: {
interactive: false,
style: {
cornerRadius: 100,
fill: '#DCDEE1',
fillOpacity: 1
}
}
},
Expand Down
1 change: 0 additions & 1 deletion packages/vchart-theme/src/chart-hub/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@ export const chartHubLightTheme: ITheme = {
treemap,
heatmap
},
// mark: markByType,
markByName
};
2 changes: 1 addition & 1 deletion packages/vchart-theme/src/legacy/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { colorLegend } from './legend/color-legend';
import { sizeLegend } from './legend/size-legend';
import type { ITheme } from '@visactor/vchart-types';
import type { ITheme } from '@visactor/vchart';

export const legacyLightTheme: ITheme = {
name: 'legacyLight',
Expand Down
2 changes: 1 addition & 1 deletion packages/vchart-theme/src/mobile/dark/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ITheme } from '@visactor/vchart-types';
import type { ITheme } from '@visactor/vchart';
import { component } from '../common/component';
import { markByName, markByType } from '../common/mark';
import { token } from '../common/constants';
Expand Down
2 changes: 1 addition & 1 deletion packages/vchart-theme/src/mobile/light/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ITheme } from '@visactor/vchart-types';
import type { ITheme } from '@visactor/vchart';
import { component } from '../common/component';
import { markByName, markByType } from '../common/mark';
import { token } from '../common/constants';
Expand Down
2 changes: 1 addition & 1 deletion packages/vchart-theme/src/theme-map.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ITheme } from '@visactor/vchart-types';
import type { ITheme } from '@visactor/vchart';
import { vScreenThemeList } from './v-screen';
import { legacyDarkTheme, legacyLightTheme } from './legacy';
import { mobileDarkTheme, mobileLightTheme } from './mobile';
Expand Down
3 changes: 2 additions & 1 deletion packages/vchart-theme/src/v-screen/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ITheme } from '@visactor/vchart-types';
import type { ITheme } from '@visactor/vchart';
import { markByName } from './mark';
import { axis } from './component/axis';
import { crosshair } from './component/crosshair';
Expand All @@ -13,6 +13,7 @@ export const getVScreenCommonTheme = (name: string, description: string, dataSch
type: 'dark',
colorScheme: getColorScheme(dataScheme),
markByName,
// @ts-ignore
series: {
...bar,
...area
Expand Down

0 comments on commit 4e9dd92

Please sign in to comment.