mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
27 lines
949 B
TypeScript
27 lines
949 B
TypeScript
import { PublicConfigClass } from '@/packages/public'
|
||
import { VChartWordCloudConfig } from './index'
|
||
import { CreateComponentType } from '@/packages/index.d'
|
||
import { vChartOptionPrefixHandle } from '@/packages/public/vChart'
|
||
import data from './data.json'
|
||
import cloneDeep from 'lodash/cloneDeep'
|
||
import { IWordCloudOption } from '../../index.d'
|
||
|
||
export const includes = ['legends', 'tooltip']
|
||
export const option: IWordCloudOption & { dataset?: any } = {
|
||
// 图表配置
|
||
type: 'wordCloud',
|
||
dataset: data,
|
||
nameField: 'name',
|
||
valueField: 'value',
|
||
seriesField: 'name',
|
||
// 业务配置(后续会被转换为图表spec)
|
||
category: VChartWordCloudConfig.category,
|
||
}
|
||
|
||
export default class Config extends PublicConfigClass implements CreateComponentType {
|
||
public key = VChartWordCloudConfig.key
|
||
public chartConfig = cloneDeep(VChartWordCloudConfig)
|
||
// 图表配置项
|
||
public option = vChartOptionPrefixHandle(option, includes)
|
||
}
|