Quantcast
Channel: Developer topics
Viewing all articles
Browse latest Browse all 17907

Custom Properties won't show

$
0
0

 Hey!

 

I'm trying to use custom properties in my visual but they won't show in the GUI. I don't know what is missing, following is the code I'm using for the properties:

 

capabilities.json:

    "objects": {
        "general": {
            "displayName": "General",
            "properties": {
                "filter": {
                    "type": {
                        "filter": true
                    }
                }
            }
        },
        "dataPoint": {
            "displayName": "Graph Settings",
            "properties": {
                 "textSize": {
                    "displayName": "Text Size",
                    "type": {
                        "formatting": {
                            "fontSize": true
                        }
                    }
                },
                "filterSelfLoops": {
                    "displayName": "Filter selfloops",
                    "type": {
                        "bool": true
                    }
                },
                "useMultipleProcesses": {
                    "displayName": "Use multiple Processes",
                    "type": {
                        "bool": true
                    }
                }
            }
        }
    }

visual.ts:

    /**
    * Interface for Flowchart Settings.
    *
    * @interface
    * @property {} dataPoint - textSize => Change the fontsize.
    *                        - filterSelfLoops => Activate to disable selfloops.
    *                        - useMultipleProcesses => Active if you want to use multiple Processes.
    *
    */
    interface FlowchartSettings {
        dataPoint: {
            textSize: string;
            filterSelfLoops: boolean;
            useMultipleProcesses: boolean;
        };
    }

 

    export class Visual implements IVisual {
        private host: IVisualHost;
        .
        .
        .
        private flowChartSettings: FlowchartSettings;
        public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstanceEnumeration {
            let objectName = options.objectName;
            let objectEnumeration: VisualObjectInstance[] = [];

            switch (objectName) {
                case 'dataPoint':
                    objectEnumeration.push({
                        objectName: objectName,
                        properties: {
                            textSize: this.flowChartSettings.dataPoint.textSize,
                            filterSelfLoops: this.flowChartSettings.dataPoint.filterSelfLoops,
                            useMultipleProcesses: this.flowChartSettings.dataPoint.useMultipleProcesses,
                        },
                        selector: null
                    });
            }
            return objectEnumeration;
        }

 

Thanks in advance for your help,

lschroth


Viewing all articles
Browse latest Browse all 17907

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>