I'm working on a project to generate a custom visual that is a matrix with 2 groups (x, y) and 2 measures. Bascially it's a heatmap were the color value is measure2 while the display value is measure1. I've been able to get it working using the basic Value Data Role. But when I tried swap it out for XAxis, YAxis, Measure1, and Measure2 data roles I can't get it to work. Below is the capabilities.json file but I can't figurout the how to setup the dataViewMappings.
Here is an example of the data:
XAxis YAxis Measure1 Measure2
Product1 State1 300 105
Product2 State1 256 75
Product1 State2 50 15
{ "dataRoles": [ { "displayName": "Display Values", "kind": "Measure", "name": "measure1" }, { "displayName": "Heat Values", "kind": "Measure", "name": "measure2" }, { "displayName": "X Axis.", "kind": "Grouping", "name": "xAxis" }, { "displayName": "Y Axis.", "kind": "Grouping", "name": "yAxis" } ], "dataViewMappings": [ { "conditions": [ { "measure1": { "max": 1 }, "measure2": { "max": 1 }, "xAxis": { "max": 1 }, "yAxis": { "max": 1 } } ], "scriptResult": { "dataInput": { "table": { "rows": { "select": [ { "for": { "in": "measure1" } }, { "for": { "in": "measure2" } }, { "for": { "in": "xAxis" } }, { "for": { "in": "yAxis" } } ], "dataReductionAlgorithm": { "top": {} } } } }, "script": { "scriptProviderDefault": "R", "scriptOutputType": "html", "source": { "objectName": "rcv_script", "propertyName": "source" }, "provider": { "objectName": "rcv_script", "propertyName": "provider" } } } } ], "objects": { "rcv_script": { "properties": { "provider": { "type": { "text": true } }, "source": { "type": { "scripting": { "source": true } } } } } }, "suppressDefaultTitle": true }