Last active
August 29, 2015 14:22
-
-
Save ghalimi/3a61e5084b2371014910 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": [ | |
{ | |
"identifier": "combination", | |
"name": "Combination Dimension", | |
"description": "Set combination dimension", | |
"operation": "SET", | |
"inputs": [ | |
{ | |
"key": "datatype", | |
"value": "stc_relationship" | |
}, | |
{ | |
"key": "options", | |
"value": { | |
"target_object": "stc_header" | |
} | |
}, | |
{ | |
"key": "value", | |
"required": true | |
} | |
] | |
}, | |
{ | |
"identifier": "serialization", | |
"name": "Serialization Dimension", | |
"description": "Set serialization dimension", | |
"operation": "SET", | |
"inputs": [ | |
{ | |
"key": "datatype", | |
"value": "stc_relationship" | |
}, | |
{ | |
"key": "options", | |
"value": { | |
"target_object": "stc_header" | |
} | |
}, | |
{ | |
"key": "value", | |
"required": true | |
} | |
] | |
}, | |
{ | |
"identifier": "filters", | |
"name": "Filtering Dimensions", | |
"description": "Set filtering dimensions", | |
"operation": "SET", | |
"inputs": [ | |
{ | |
"key": "datatype", | |
"value": "stc_relationship" | |
}, | |
{ | |
"key": "options", | |
"value": { | |
"target_object": "stc_header" | |
} | |
}, | |
{ | |
"key": "multiple", | |
"value": true | |
}, | |
{ | |
"key": "value", | |
"required": true | |
} | |
] | |
}, | |
{ | |
"identifier": "underlyings", | |
"name": "Underlying Dimensions and Aggregations", | |
"description": "Set underlying dimensions and aggregations", | |
"operation": "SET", | |
"inputs": [ | |
{ | |
"key": "datatype", | |
"value": "stc_json" | |
}, | |
{ | |
"key": "options", | |
"value": { | |
"stc_schema": { | |
"title": "Underlying Schema", | |
"type": "object", | |
"properties": { | |
"dimension": { | |
"stc_datatype": "stc_relationship", | |
"name": "Dimension", | |
"stc_options": { | |
"target_object": "stc_header" | |
} | |
}, | |
"aggregation": { | |
"stc_datatype": "stc_category", | |
"name": "Aggregation", | |
"stc_options": { | |
"stc_categories": [ | |
{ | |
"stc_name": "SUM", | |
"stc_identifier": "stc_sum" | |
}, | |
{ | |
"stc_name": "AVERAGE", | |
"stc_identifier": "stc_average" | |
} | |
] | |
} | |
} | |
} | |
} | |
} | |
}, | |
{ | |
"key": "multiple", | |
"value": true | |
}, | |
{ | |
"key": "value", | |
"required": true | |
} | |
] | |
}, | |
{ | |
"identifier": "groupings", | |
"name": "Grouping Dimensions", | |
"description": "Set grouping dimensions", | |
"operation": "SET", | |
"inputs": [ | |
{ | |
"key": "datatype", | |
"value": "stc_relationship" | |
}, | |
{ | |
"key": "options", | |
"value": { | |
"target_object": "stc_header" | |
} | |
}, | |
{ | |
"key": "multiple", | |
"value": "true" | |
}, | |
{ | |
"key": "value", | |
"value": "UNION($filters, MAP($underlyings, 'dimension'))" | |
} | |
] | |
}, | |
{ | |
"identifier": "aggregations", | |
"name": "Aggregations", | |
"description": "Set aggregation dimensions", | |
"operation": "SET", | |
"inputs": [ | |
{ | |
"key": "datatype", | |
"value": "stc_json" | |
}, | |
{ | |
"key": "options", | |
"value": "TBD" | |
}, | |
{ | |
"key": "value", | |
"value": "MAP($underlyings, 'aggregation')" | |
} | |
] | |
}, | |
{ | |
"identifier": "groups", | |
"name": "Non-null Groups", | |
"description": "Pivot non-null groups from grouping dimensions", | |
"operation": "PIVOT", | |
"inputs": [ | |
{ | |
"key": "definition", | |
"value": { | |
"columns": "$groupings", | |
"values": [ | |
"COUNT()" | |
], | |
"when": "NOT(null)" | |
} | |
} | |
] | |
}, | |
{ | |
"identifier": "series", | |
"name": "Data Series", | |
"description": "Pivot data series to be combined", | |
"operation": "PIVOT", | |
"for": { | |
"each": "$groups", | |
"type": "parallel" | |
}, | |
"inputs": [ | |
{ | |
"key": "definition", | |
"value": { | |
"columns": [ | |
"$combination" | |
], | |
"rows": [ | |
"$serialization" | |
], | |
"slices": "$groups.value.subset", | |
"values": "$aggregations" | |
} | |
} | |
] | |
}, | |
{ | |
"identifier": "categories", | |
"name": "Categories", | |
"description": "Set categories to be combined", | |
"operation": "SET", | |
"for": { | |
"each": "$aggregations", | |
"type": "parallel" | |
}, | |
"inputs": [ | |
{ | |
"key": "datatype", | |
"value": "stc_list" | |
}, | |
{ | |
"key": "value", | |
"value": "AXES($series.value, $aggregations.value)" | |
} | |
] | |
}, | |
{ | |
"identifier": "evaluation", | |
"name": "Evaluation", | |
"description": "Evaluate expression on every combination", | |
"operation": "SET", | |
"for": { | |
"each": "$categories", | |
"type": "combination", | |
"k": 2 | |
}, | |
"inputs": [ | |
{ | |
"key": "value", | |
"value": "PEARSON($categories[0].value, $categories[1].value)" | |
} | |
] | |
} | |
], | |
"ui": [ | |
{ | |
"identifier": "treemap", | |
"name": "Treemap", | |
"description": "Treemaps for drill-down into grouping dimensions", | |
"chart": "stc_treemap", | |
"multiple": true, | |
"bindings": [ | |
{ | |
"dimension": "stc_category", | |
"data": "groupings" | |
}, | |
{ | |
"dimension": "stc_color", | |
"data": "COUNTIF(value < 0.5) / COUNT()", | |
"rollup": "AVERAGE" | |
}, | |
{ | |
"dimension": "stc_size", | |
"data": "evaluation", | |
"rollup": "MIN" | |
} | |
] | |
}, | |
{ | |
"identifier": "heatmap", | |
"name": "Heatmap", | |
"description": "Heatmap of evaluations across combinations", | |
"chart": "stc_heatmap", | |
"bindings": [ | |
{ | |
"dimension": "stc_column", | |
"data": "categories" | |
}, | |
{ | |
"dimension": "stc_row", | |
"data": "categories" | |
}, | |
{ | |
"dimension": "stc_color", | |
"data": "evaluation", | |
"rollup": "MIN" | |
} | |
] | |
}, | |
{ | |
"identifier": "linechart", | |
"name": "Line Chart", | |
"description": "Line chart of last grouping dimension across serialization dimension for combination", | |
"chart": "stc_line", | |
"bindings": [ | |
{ | |
"dimension": "stc_date", | |
"data": "serialization" | |
}, | |
{ | |
"dimension": "stc_values", | |
"data": "LAST(groupings)" | |
}, | |
{ | |
"dimension": "stc_series", | |
"data": "Reference to current combination" | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment