microsoft / powerbi-desktop-samples

Power BI Desktop sample files for the monthly release. Here you can find the PBIX files used in the monthly release videos.
MIT License
1.48k stars 892 forks source link

Missing "Image" from visual styles #58

Closed OscarValerock closed 1 year ago

OscarValerock commented 1 year ago

Hi @yelper !

The "image" visual style is missing from the schema.

image

But this can be used in a theme without problems.

image

yelper commented 1 year ago

I've prototyped something for the schema that would ship with the May release. Here's the schema generated, please let me know if you see an issue with it!

"image": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "*": {
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/commonCards"
                },
                {
                    "properties": {
                        "*": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "imageUrl": {
                                        "type": "string"
                                    },
                                    "imageScalingType": {
                                        "type": "string",
                                        "oneOf": [
                                            {
                                                "const": "Normal",
                                                "title": "Normal"
                                            },
                                            {
                                                "const": "Fit",
                                                "title": "Fit"
                                            },
                                            {
                                                "const": "Fill",
                                                "title": "Fill"
                                            }
                                        ],
                                        "title": "Scaling"
                                    }
                                }
                            }
                        },
                        "general": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "imageUrl": {
                                        "type": "string"
                                    }
                                }
                            }
                        },
                        "imageScaling": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "imageScalingType": {
                                        "type": "string",
                                        "oneOf": [
                                            {
                                                "const": "Normal",
                                                "title": "Normal"
                                            },
                                            {
                                                "const": "Fit",
                                                "title": "Fit"
                                            },
                                            {
                                                "const": "Fill",
                                                "title": "Fill"
                                            }
                                        ],
                                        "title": "Scaling"
                                    }
                                }
                            },
                            "title": "Scaling"
                        }
                    }
                }
            ]
        }
    }
},
OscarValerock commented 1 year ago

2023-04-06_10-30-26 Seems to be working great, looking forward to the next release. Thanks!