@cainiaofe/cn-ui-charts
Version:
61 lines (60 loc) • 2.06 kB
JavaScript
import { Bundle } from '@ali/visualengine';
import Icon from "./logo";
import ChartServiceSelectSetter from "../../common/setter/chart-service-select-setter";
import { createFilterConfigSetter, getChartCommonStyleSetterSnippet, getComponentTitle, getNodeIdSetterSnippet, getObjectSetterSnippet } from "../../common/manager/setter-snippet";
import { __advancedConfig__ } from "../../common/util/const";
import { getMixedSetterSnippet } from "../../common/setter/statistic-setter";
import { createDataSourceSetters, getJSExpressionPrototype } from "../../common/util/util";
// 原型配置请参考:https://lark.alipay.com/vision/docs/prototype
export default Bundle.createPrototype({
title: '动态图表',
componentName: 'CnDynamicChart',
category: '图表',
icon: Icon,
docUrl: '',
enableCopy: true,
snippets: [{
screenshot: 'https://img.alicdn.com/imgextra/i1/O1CN016HM4mf1wPuTBBQ3I6_!!6000000006301-0-tps-2724-1600.jpg',
label: 'CnDynamicChart',
schema: {
componentName: 'CnDynamicChart',
props: {}
}
}],
configure: [{
name: 'isCnChart',
title: 'isCnChart',
initialValue: true,
display: 'none'
}, {
name: '_context',
title: '上下文',
initialValue: {
type: 'JSExpression',
value: 'this'
},
display: 'none'
}, getComponentTitle({
initialValue: '动态图表1'
}), {
name: 'dataFrom',
title: '数据来源',
setter: /*#__PURE__*/React.createElement(ChartServiceSelectSetter, null)
}, createFilterConfigSetter(), getChartCommonStyleSetterSnippet(), {
name: __advancedConfig__,
title: '高级配置',
display: 'accordion',
setter: getObjectSetterSnippet({
items: [{
name: 'handleProps',
title: '手动设置图表配置(G2 Spec API协议)',
display: 'inline',
setter: getMixedSetterSnippet({
setters: [getJSExpressionPrototype({
type: 'handleProps'
})]
})
}]
})
}].concat(createDataSourceSetters(), [getNodeIdSetterSnippet()])
});