[{"id":"cf9e6fa8-0b86-49e2-ac68-07594c7af412","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"d3324a01-b600-4674-8aee-dac1f6640ec9","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"3e247fcf-cdb2-4f60-a969-1498a5bfdb2d","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"f8fae864-8593-4474-a823-ae63aa34f17c","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"931caca9-ac3f-4fb9-bd21-c561b8f4c131","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"31b37c80-894c-4ddb-8445-0ddb77116ebf","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"7827c267-c18d-4225-a98a-69abc788f00d","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"75958fc3-b020-4620-a44c-34e00d53c6ab","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"8cdb3b7d-dca1-4490-bebc-d8faa2998eb4","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"94d72550-4999-4422-aaa0-0a149d42e4fd","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"087e3f2a-f18d-4838-a51d-1d98539c8b0f","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"0d8daadd-44fb-4e7d-bfae-d7e3c494fbdc","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"4100a562-8227-463d-8cd7-a86c028c7980","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"967ee563-9ecf-44e2-99a4-e91fe8dbc722","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"ad4c4887-a925-4aa3-a65c-6988bbc71603","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"282ed04c-5f92-4348-a82e-125448d5c70e","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"3ca1ce65-7f2e-4b1b-8846-361962f50ed0","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"e1fb1b27-6f94-4100-bb0e-7b43d63781eb","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"9a39e982-c66b-489e-b0e1-bfa1bcd15a70","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"274f82b6-deda-49dc-8487-95028b51195c","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"5c518362-9fbf-484c-80ef-72d2ec815c2d","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"53d6e6ad-c925-491c-9faa-0f374d8904e0","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"1d5eb6c4-41cd-4121-8273-c8555932ed35","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"7e47a724-c7be-464b-bf41-6c8844499cd1","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"207aa98c-0f41-4b44-95a5-cd18c154c79d","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"b033909b-d5a9-448e-9238-a044d0c6c062","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"9478d8b4-6bd7-4049-ad88-54593e69123c","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"beb379f4-f287-49b1-9c9b-a396e6c04a2d","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"3f2daab3-114b-41f3-916f-b2df9f377634","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"240b019b-37c2-4426-a9ca-d4e57d48ffec","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"6d91ce8c-1454-408b-b42a-f13ed34d7741","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"b947ca15-7493-455f-834b-f1bddb015cde","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"bca11f89-3090-45c9-8730-9d2bfe3d8533","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"8a50b408-80ee-443d-a2d6-ba6d4e0cff64","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2928a65c-9eb7-4566-947d-dcd1b964242a","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"dac60248-5749-4548-96c1-5ac67b63dfba","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"30d4007d-ac66-497f-b333-92fbf155f379","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"7243b1bf-b870-4199-a0d9-accf339eaf9a","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"de71aa3e-78f6-412f-99eb-b89cde8a0cb7","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"1245bac8-b2d7-4bb7-a0d4-ca10152819f3","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"76f3c859-c392-44dc-af32-6003bfe33fe2","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"de23f283-0ab0-44f4-bb22-5a3771cd5366","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"8cde5af9-f36a-4bc2-a396-76735b77adfc","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"3ff57337-c9a3-4afe-971e-a2ffa073d412","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"395b26ec-782f-447c-b558-d565b399ac81","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"4690b659-1897-49d5-8743-adc5eb02d41f","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"b35f451b-a8e4-41ec-a686-a940d1c62271","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"041092ab-8521-4e42-9a41-094038252b05","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"6f87b8ff-da60-4307-af0a-8e73170cfc0c","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"cb06d0d4-32e7-4c71-a53a-9885cbe10ce5","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"36611fc3-508f-430b-a33b-86ffb4b2c1c9","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"e5514e63-4aaa-456c-9c76-b462ddc4a85c","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"9e8b8e90-de25-49a0-abb4-551bc5ea9e64","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"6678d138-580e-4b9b-b81f-55e328061d72","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"c14b681e-ebf8-4fdb-953d-ed9972772441","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"b270146e-438e-43ec-a233-c509042c9600","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]}]
        
(Showing Draft Content)

Options

用于描述该组件具有哪些属性设置项。


interface

interface IOptions {
    common?: {
		size?: ISize;
   		margin?: IPosition;
		filter?: boolean; // enable slicer
	};
    visual?: IVisualCategory[];
}
enum InheritProperty {
    Palette = 'dashboard.palette',
    TextStyle = 'dashboard.textStyle',
    TitleTextStyle = 'dashboard.titleTextStyle',
    BackgroundColor = 'dashboard.backgroundColor',
}
enum PublicPropertyType {
    Text = 'Text', // input
    Integer = 'Integer', // input with step button
    Float = 'Float', // number
    Boolean = 'Boolean', // switch
    LongText = 'LongText', // text area
    Enum = 'Enum', // dropdown
    Color = 'Color', // color panel
    Percentage = 'Percentage', // slider
    Format = 'Format', // format dialog
	DisplayUnit = 'DisplayUnit',
    Angle = 'Angle', // slider
    Palette = 'Palette',
    TextStyle = 'TextStyle',
    Position = 'Position',
    Image = 'Image',
    Hidden = 'Hidden', // null
	ColorAssignment = 'ColorAssignment',
    Collection = 'Collection';
  }
enum CategoryType {
    Title = 'title',
    Appearance = 'appearance',
    Custom = 'custom',
    Interaction = 'interaction',
}
interface IVisualCategory extends ILocalizable {
    type?: CategoryType;
    properties?: IVisualProperty[];
}
interface IProperty {
    name: string;
    inheritFrom?: InheritProperty;
    defaultValue?: any;
    structuredPath?: string;
}
interface IVisualProperty extends IProperty {
    type?: PublicPropertyType;
    hidden?: boolean;
}

Options 描述可视化组件的属性设置,公共设置代表着初始的大小和边距。可以通过hidden标志将任何属性从属性面板隐藏

对于属性设置面板来说,有四种类型。

  • name:属性名称。

  • inheritFrom: indicate this property inherit. It can inherit from the dashboard property, or a sibling.表示属性的继承。可以从dashboard 属性 或者同级继承。

  • defaultValue: 默认值。

  • structuredPath:父属性路径。示例


    {

    a: {

    b: {

    c: '#fff'

    }

    }

    }

    {

    "name": "c",

    "type": "Color",

    "displayName": "Text Color",

    "defaultValue": "#fff",

    "structuredPath": "a.b"

    }

Category

类型

interface

描述

示例截图

标题

(title)

interface ITitleCategory extends IVisualCategory {

disable?: {

auto?: boolean,

alignment?: boolean,

};

defaultValue?: {

show?: boolean,

alignment?: string,

};

}

参数:

disable:表示当前组件不需要此属性。

defaultvalue:默认值。

image2020-6-1_16-16-21.png

外观样式

(appearance)

interface IAppearanceCategory extends IVisualCategory {

disable?: {

batchSetStyle?: boolean,

backgroundColor?: boolean,

padding?: boolean,

margin?: boolean,

backgroundImage?: boolean,

border?: boolean,

shadow?: boolean,

};

}


image2020-6-1_16-20-44.png

数据交互

(interaction)

interface IInteractionCategory extends IVisualCategory {

disable?: {

crossFilter?: boolean,

jumpTo?: boolean,

dataSetAutoRefresh?: boolean,

hiddenActions?: boolean,

pinAnnotation?: boolean,

};

defaultValue?: {

crossFilter?: boolean,

};

watchParameter?: {

roles: string[];

staticOnly?: boolean;

};

}

如果未设置此类别或禁用 crossFilter。选择管理器不会触发交叉过滤器。

watchParameter 用于定义参数映射,当 staticOnly 为 true 时,只能绑定静态参数。

image2020-6-1_16-22-22.png

自定义

(custom)


属性:

属性属于此类别


Property

类型

interface

示例图(请参考)

说明

示例

Text

interface IStringProperty extends IVisualProperty {

maxLength?: number;

regex?: string | RegExp;

}


image2020-6-1_16-27-25.png

maxLength: 文本的最大长度

regex: 文本模式

{

"name": "test",

"type": "Text",

"displayName": "Test",

"maxLength": 10,

"regex": "^aaa"

}

Integer

interface IIntegerProperty extends IVisualProperty {

max?: number;

min?: number;

step?: number;

}

image2020-6-18_18-3-58.png

max: 最大

min: 最小

step: 步骤

{

"name": "test",

"type": "Integer",

"displayName": "Test"

}

Float

interface IFloatProperty extends IVisualProperty {

min?: number;

max?: number;

placeholder?: string;

}

image2020-6-18_18-4-22.png



Boolean


image2020-6-18_18-4-40.png



LongText

interface ILongTextProperty extends IVisualProperty {

rows?: number;

}

image2020-6-18_18-6-49.png

rows: 文本区域行号。


Enum

interface IEnumProperty extends IVisualProperty {

items: Array<CommonDefNS.IEnumItem>;

}

image2020-6-18_18-8-7.png

items: 下拉项目。

{

"name": "test",

"type": "Enum",

"displayName": "Test",

"items": [

{

"value": "a",

"displayName": "A"

},

{

"value": "b",

"displayName": "B"

}]

}

Command


image


{

"name": "command",

"type": "Command",

"displayNameKey": "command",

"items": [

{

"value": "HideScenario",

"displayNameKey": "HideScenario"

},

{

"value": "ShowScenario",

"displayNameKey": "ShowScenario"

},

{

"value": "ToggleScenario",

"displayNameKey": "ToggleScenario"

}

]

}

Color

export enum ColorResetType {

None = 'none',

Auto = 'auto',

NoFill = 'noFill',

}

interface IColorProperty extends IVisualProperty {

resetType?: ColorResetType;

}

image

resetType 表示在单击红色圆圈中的按钮时的效果。

none:隐藏按钮

auto:点击自动按钮将清除数据

no fill:单击no fill按钮将设置一个no fill关键字


Percentage

interface IPercentageProperty extends IVisualProperty {

max?: number;

min?: number;

}

image2020-6-18_18-8-37.png



Format


image2020-6-18_18-8-48.png



DisplayUnit


image



Angle

interface IAngleProperty extends IVisualProperty {

min: number;

max: number;

step?: number;

markStep?: number;

marks?: number[];

}

image2020-6-18_18-9-0.png

step:拖动光标时的步骤。

markerStep:绘制标记时的步骤

makers:定制标记


Palette


image2020-6-18_18-9-14.png



TextStyle

interface ITextStyleProperty extends IVisualProperty {

fontFamilyList?: string[];

}

image2020-6-18_18-9-26.png

fontFamilyList: 可选字体。


Position


image2020-6-18_18-9-39.png



Image


image2020-6-18_18-9-50.png



Hidden


Hidden 类型的属性没有固定的结构, 可以是字符串, 数字, 数组, 或者复杂对象。 它不会渲染任何UI在属性面板上, 只能通过visual api 的property service 进行修改



ColorAssignment

interface IColorAssignmentProperty extends IVisualProperty {

alias?: string;

palettePath?: string;

}

image2021-2-25_16-25-4.png

alias:visual.ts中颜色分配配置的键。palettePath:默认的调色板值路径。

要使用这个属性,你必须在visual上实现 "getColorAssignmentConfigMapping "方法。ColorAssignmentConfig的关键是别名或名称。

当启用它时,你将得到一个颜色映射对象的属性。

{

"name": "mainColorAssignment",

"type": "ColorAssignment",

"displayName": "Enable Color Assignment",

"defaultValue": true

}

Collection

enum ItemType {

Text = 'Text',

Integer = 'Integer',

Float = 'Float',

Boolean = 'Boolean',

LongText = 'LongText',

Enum = 'Enum',

Color = 'Color',

Percentage = 'Percentage',

Format = 'Format',

DisplayUnit = 'DisplayUnit',

Slider = 'Slider',

Image = 'Image',

}

interface IItemProperty {

name?: string;

displayName?: string;

displayNameKey?: string;

defaultValue?: any;

type: ItemType;

}

interface ICollectionProperty extends IVisualProeprty {

itemShape: IItemProperty

IItemProperty[];

defaultValue?: any[];

}

IItemProperty 子类:

interface IItemStringProperty extends IItemProperty {

maxLength?: number;

regex?: string

RegExp;

}

interface IItemIntegerProperty extends IItemProperty {

max?: number;

min?: number;

step?: number;

}

interface IItemFloatProperty extends IItemProperty {

min?: number;

max?: number;

placeholder?: string;

}

interface IItemLongTextProperty extends IItemProperty {

rows?: number;

}

interface IItemEnumProperty extends IItemProperty {

items: Array<CommonDefNS.IEnumItem>;

}

interface IItemColorProperty extends IItemProperty {

resetType?: ColorResetType;

}

interface IItemPercentageProperty extends IItemProperty {

max?: number;

min?: number;

}

interface IItemSliderProperty extends IItemProperty {

min: number;

max: number;

step?: number;

markStep?: number;

marks?: number[];

}

示例:

image2021-5-25_15-18-59.png

image2021-5-25_15-19-24.png


定义:

{

name: 'collection',

displayName: 'Collection',

type: 'Collection',

itemShape: [

{

name: 'name',

displayName: 'Name',

type: 'Text',

},

{

name: 'min',

displayName: 'Min',

type: 'Integer',

},

{

name: 'max',

displayName: 'Max',

type: 'Integer',

},

{

name: 'color',

displayName: 'Color',

type: 'Color'

}

],

defaultValue: [],

}

使用方法:

const list = properties.collection;

/list: [ { name: '0~59', min: 0, max: 59, color: 'red' }, { name: '60~79', min: 60, max: 79, color: 'yellow' }, { name: '80~100', min: 80, max: 100, color: 'green' },]/

ClickAction

enum InteractionMouseEventAction {

ShowTooltip = 'showTooltip',

None = 'none',

Keep = 'keep',

Exclude = 'exclude',

DrillTo = 'drillTo',

JumpTo = 'jumpTo',

AddMonitor = 'addMonitor',

}

interface IClickActionProperty extends IVisualProperty {

disableActions?: Array<InteractionMouseEventAction>;

}

image

disableActions:禁用操作项。

{

"name": "clickAction",

"type": "ClickAction",

"displayName": "Click Action"

}