[{"id":"bcb0874d-299b-448e-9552-9e9b25ef80dd","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"8ce3627e-9e58-471b-9133-4f135d191e7b","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"ae60ae59-34f5-4f32-a8eb-243ed1457543","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"3d4848c3-910f-4ffa-9153-60bb507334a9","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"133f4ca6-d951-4d65-a618-3dc6301266f7","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"de62ec1c-813e-40b1-8160-a4cd109afe64","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2426c71d-8332-4cbd-a436-1ec4f8666464","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2ce7b6b0-78aa-4e4b-bf8a-e4ba2f988298","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"4706db46-0811-4652-8f59-1e0a1da84758","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"8f1271bb-2cd9-4f39-9897-c15b239ee7ab","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"677e13a7-6f3e-449f-986c-2c3a26f8d54f","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"5e40f6dc-caec-49d7-a1d0-be65f06815ba","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2457f0e0-9e71-4860-a87d-065e0fb84f84","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"d5c67fd0-1145-482c-9113-97b492c44c18","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"a609a8fa-ab91-4c1d-a1c3-d209d0463303","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"b4a9eb15-94e5-48df-b218-a24138f0cf9c","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]}]
Actions 主要用于控制可视化组件在设计以及预览/运行时具有哪些数据探索类的操作能力,如下图所示的红框区域中的功能(图中以柱状图设计状态为例)。
interface IAction extends CommonDefNS.IMember {
type: ActionType;
}
action | interface | 描述 | 示例 | 设计状态下是否可用 | 运行状态下是否可用 |
---|---|---|---|---|---|
filter | 为可视化组件添加数据过滤功能。 | { "type": "filter" } | y | y | |
sort | 为可视化组件添加排序功能。 当启用sort功能后, 需要在消费dataView的地方自行根据dataView的sort字段信息对数据进行排序 | { "type": "sort" } | y | y | |
rank | 为可视化组件添加排名功能。 | { "type": "rank" } | y | y | |
convertVisual | interface IConvertVisualAction extends IAction { disableChangePivotSetting?: boolean; disableChangeChartType?: boolean; } | 为组件增加设计状态时转换图表类型的功能和运行状态下修改数据绑定的功能。 (设计状态下) (预览和运行状态下) | { "type": "convertVisual" } | y | y |
edit | 为组件添加编辑能力,例如内置的富文本或筛选器组件。 | { "type": "edit" } | y | n | |
focus | 为组件添加聚焦功能。 | { "type": "focus" } | y | y | |
showData | interface IShowDataAction extends IAction { disableCustomData?: boolean; rule: DataBindingDefNS.IConversionRules; } | 为组件添加聚焦状态时显示数据透视表的能力。 参数:
- disableCustomData:为true的话,将不支持自定义数据的功能。 - rule:更改为数据透视表的转换规则。 有关转换规则的更多信息,请参阅Data Binding。 | { "type": "showData", "rule": { "out": [ { "mode": "post", "execute": [ { "source": "dimensions", "target": "columns", "cmd": "all" }] }] } } | y | n |
export | interface IExportAction extends IAction { disablePNG?: boolean; disableExcel?: boolean; } | 为组件添加导出能力。 参数: disablePNG:禁用“导出PNG图片” disableExcel:禁用“导出数据”。 | { "type": "export" } | n | y |
annotation | 为组件添加批注功能。 | { "type": "annotation" } | y | n | |
extension (扩展操作) | enum ExtensionType { Toggle = 'toggle', Enum = 'enum', ReferenceLine = '_referenceLine', TrendLine = '_trendLine', ImagePicker = '_imagePicker', ConditionalFormat = '_conditionalFormat', } interface IExtensionAction extends IAction { path: string; extensionType: ExtensionType; horizontal?: boolean; } interface IToggleExtension extends IExtensionAction { toggleState?: Array<CommonDefNS.ILocalizable & CommonDefNS.IIconable>; } interface IEnumExtension extends IExtensionAction { items: CommonDefNS.IEnumItem[]; } interface IReferenceLineExtension extends IExtensionAction { axis?: CommonDefNS.IEnumItem[]; _scope?: boolean; _constOnly?: boolean; } interface IConditionalFormatExtension extends IExtensionAction { roleNameList?: string[]; dataRole?: string; } | Extension action is a special action. It will map the value from the visual property. So you can add some property editor on action bar. Currently, we support toggle, enum editor. 用于将组件的某些属性映射到操作栏中。这样您就可以将部分常用属性的设置添加到操作栏中,使其用起来更加便利。 目前支持添加到操作栏中的属性包括切换类型(toggle)和枚举类型(enum)的属性。 注意 当添加了扩展项以后,需要添加关键字“path”,它的值为属性的名称。 参数: path:映射的属性名称。 extensionType:对应的操作 horizontal: 应显示为水平还是垂直。
Toggle特有参数: toggleState: 定义 true 状态时的表现和icon;false 状态时的表现和icon。
Enum特有参数: item:下拉项目。 | { "type": "extension", "name": "showBorder", "displayName": "Show Border", "path": "showBorder", "extensionType": "toggle", "toggleState": [ { "displayName": "show", "iconCss": "icon-expand" }, { "displayName": "hide", "iconCss": "icon-expand" }] } | y | y |
event (事件类操作) | interface IEventAction extends IAction { horizontal?: boolean; } | 自定义操作按钮。 在EventService上添加一个侦听器,如果单击此操作按钮,则将调用callback。 | { "name": "log", "type": "event", "icon": "", "displayName": "Log Event Test" } | y | y |
shareScenario | 以iframe或DIV方式分享组件。 | { "type": "shareScenario" } | y | n | |
openFullDashboard | 共享场景时,用户可以通过操作打开相应的仪表板。 | { "type": "openFullDashboard" } | y | n | |
clearSelection | 在运行时清除当前场景的选择。 | { "type": "clearSelection" } | n | y | |
analysisPath | 记录运行时的用户操作(过滤、排序、排名...),以便用户轻松切换不同状态。 | { "type": "analysisPath" } | n | y | |
saveAsTemplate | 添加保存为模板的功能。 | { "type": "saveAsTemplate" } | y | n |