Power Lenses
Power Lenses are very similar to Lenses except they give you greater granular control and flexibility and are typically used to remove boxes from an Illustration, where as Lenses typically add something to boxes within an Illustration. Power Lenses are built with a little knowledge of JSON code, however, all the examples provided simply require you to replace the reference-names with real values from your Illustration. A Power Lens can also be created from a Global Lens (mixin) in exactly the same way that is detailed below.
If you have the Lens already turned on in the Advanced Box Types Menu - you will need to turn it off from here for this Power Lens to work
You must ensure that anywhere you wish to apply a Power Lens to, that the parent box is different to the child boxes.
The reference names within a Power Lens are listed below and you will need to replace their values with the actual values from your Illustration:
| Reference Name | Description |
|---|---|
| Internal Power Lens menu name | The internal name for the Power Lens Menu |
| Display Power Lens menu name | This actual Power Lens Menu that will appear in the Left Hand Menu under Power Lenses |
| Internal Name | The internal menu item name |
| Display Name | The actual menu item name that will appear in the Left Hand Menu |
| Box Type UUID | This is the UUID of the Box Type that contains the attribute you would like to create a lens for. |
| Attribute UUID | This is the UUID of the Lens that you would like to perform a condition against |
| Attribute Operator | This is one of the operators <, <=, >, >=, !=, == |
| Attribute Value | This is the value that you would like to compare against. |
| boxIsInLayout | Whilst this does not need to change - if set to true then the boxes remain in their current position and are hidden. If set to false then the boxes are removed and the other boxes re-arrange themselves for a best fit |
Power Lens Syntax - Single Entity
"Internal Name": {
"name": "Display Name",
"order": 100,
"queries": [
{
"boxTypeExpressions": {
"Box Type UUID": "=="
},
"attributeExpression": {
"attributeType": "Attribute UUID",
"operator": "Attribute Operator",
"attributeValue": "Attribute Value"
},
"operator": "and",
"applyBoxVisibility": true,
"boxIsVisible": false,
"boxIsInLayout": true
}
]
},
Power Lens Syntax - Two Entities
"Internal Name": {
"name": "Display Name",
"order": 100,
"queries": [
{
"boxTypeExpressions": {
"Box Type UUID": "=="
},
"attributeExpression": {
"attributeType": "Attribute UUID",
"operator": "Attribute Operator",
"attributeValue": "Attribute Value",
"children": [
{
"attributeType": "Attribute UUID 2",
"operator": "Attribute Operator 2",
"attributeValue": "Attribute Value 2"
}
],
"childrenOperator": "and",
"childrenExpressionOperator": "or"
},
"operator": "and",
"applyBoxVisibility": true,
"boxIsVisible": false,
"boxIsInLayout": true
}
]
},
Power Lens Syntax - Three Entities
"Internal Name": {
"name": "Display Name",
"order": 127,
"queries": [
{
"boxTypeExpressions": {
"Box Type UUID": "=="
},
"attributeExpression": {
"attributeType": "Attribute UUID",
"operator": "Attribute Operator",
"attributeValue": "Attribute Value",
"children": [
{
"attributeType": "Attribute UUID 2",
"operator": "Attribute Operator 2",
"attributeValue": "Attribute Value 2"
},
{
"attributeType": "Attribute UUID 3",
"operator": "Attribute Operator 3",
"attributeValue": "Attribute Value 3"
}
],
"childrenOperator": "and",
"childrenExpressionOperator": "or"
},
"operator": "and",
"applyBoxVisibility": true,
"boxIsVisible": false,
"boxIsInLayout": true
}
]
},
Power Lens Syntax - Four Entities
"Internal Name": {
"name": "Display Name",
"order": 127,
"queries": [
{
"boxTypeExpressions": {
"Box Type UUID": "=="
},
"attributeExpression": {
"attributeType": "Attribute UUID",
"operator": "Attribute Operator",
"attributeValue": "Attribute Value",
"children": [
{
"attributeType": "Attribute UUID 2",
"operator": "Attribute Operator 2",
"attributeValue": "Attribute Value 2"
},
{
"attributeType": "Attribute UUID 3",
"operator": "Attribute Operator 3",
"attributeValue": "Attribute Value 3"
},
{
"attributeType": "Attribute UUID 4",
"operator": "Attribute Operator 4",
"attributeValue": "Attribute Value 4"
}
],
"childrenOperator": "and",
"childrenExpressionOperator": "or"
},
"operator": "and",
"applyBoxVisibility": true,
"boxIsVisible": false,
"boxIsInLayout": true
}
]
},
Adding a Power Lens to your Illustration
To add a Power Lens to your illustration you will need create the structure and names that you would like see in the menu. Everything to do with Power Lenses is maintained in the right hand menu within the JSON Editor section
| JSON Editor | Description |
|---|---|
| Power Lens Groups | This will create the menu structure that you see within the Left Hand Menu |
| Power Lenses | This is where you create the Power Lens itself and they will appear as menu items in the menu structure created above. |
Power Lens Groups
This is where you create the menu structure that you will see in the left hand menu. If you click on the Power Lens Groups box, the following format will appear:
{
"General Lens": {
"name": "General Lens",
"order": -1,
"lensKeys": [
"Is Canvas",
"Has Lens Pages"
]
}
}
You will notice that this is the default setting and this Power Lens menu appears in every Illustration that is created. These are the two default Power Lenses that allow you to see at a glance which Boxes have been set to be a Canvas and which Boxes have a Lens Page. The Power Lenses that do this are Is Canvas and Has Lens Pages.
The General Lens menu is reserved for these two entries and you should not place your own Power Lenses in here are they will be reset/removed when you next open the Illustration.
To create your own menu entry, simply copy the Syntax to create something like the following:
{
"General Lens": {
"name": "General Lens",
"order": -1,
"lensKeys": [
"Is Canvas",
"Has Lens Pages"
]
},
"My Power Lens": {
"name": "My Power Lens Menu",
"order": -1,
"lensKeys": [
"Power Lens - Single Entity",
"Power Lens - Single Entity2",
"Power Lens - 2 Entities"
]
}
}
The entries in My Power Lens Menu are currently both blank as we have yet to add the actual lenses that associate with the menu structure
The current left hand menu structure now has the name we gave it My Power Lens Menu, however, the menu items appear blank. At this point, we have only created a place holder for the Power Lens, we now actually need to create the Power Lens for the names to appear.
Power Lenses
This is where you create the Power Lens itself. If you click on the Power Lenses box, the following format will appear:
You will notice that this is the default JSON for the Is Canvas and Has Lens Pages Power Lens
Example 1: Strategic = True
In this example, we will use the default Illustration, and we are going to remove all boxes that are not strategic. To start, we are going to use our single entity syntax. In the right hand menu, navigate to the JSON editor and click on the Power Lenses box and copy the Syntax from below ( based on [Single Entity](#Power Lens Syntax - Single Entity) ) and add or append it.
"Power Lens - Single Entity": {
"name": "Strategic",
"order": 100,
"queries": [
{
"boxTypeExpressions": {
"fc40ff80-42c1-47a2-a6fb-363ea23bb53a": "=="
},
"attributeExpression": {
"attributeType": "1154c463-9474-448d-b477-b425e98d176c",
"operator": "!=",
"attributeValue": "True"
},
"operator": "and",
"applyBoxVisibility": true,
"boxIsVisible": false,
"boxIsInLayout": true
}
]
},
We populated the Lens above with the following values, taken from Strategic Lens within the Business Function Box Type of the Default Illustration
| Reference Name | Description | Value used |
|---|---|---|
| Internal Power Lens menu name | The internal name for the Power Lens Menu | My Power Lens |
| Display Power Lens menu name | This actual Power Lens Menu that will appear in the Left Hand Menu under Power Lenses | My Power Lens Menu |
| Internal Name | The internal menu item name | Power Lens - Single Entity |
| Display Name | The actual menu item name that will appear in the Left Hand Menu | Strategic |
| Box Type UUID | This is the UUID of the Box Type that contains the attribute you would like to create a lens for. | fc40ff80-42c1-47a2-a6fb-363ea23bb53a |
| Attribute UUID | This is the UUID of the Lens that you would like to perform a condition against | 1154c463-9474-448d-b477-b425e98d176c |
| Attribute Operator | This is one of the operators <, <=, >, >=, !=, == | != |
| Attribute Value | This is the value that you would like to compare against. | True |
The addition of the new Power Lens, enriched the left hand menu to give the following:
Placing this text into the Power Lenses JSON Editor produces this left hand menu Strategic
Example 2: Change = Low
In this example, we will use the default Illustration, and we are going to remove all boxes from the illustration and only leave those where Change = Low. To start, we are going to use our single entity syntax. In the right hand menu, navigate to the JSON editor and click on the Power Lenses box and copy the Syntax from below ( based on [Single Entity](#Power Lens Syntax - Single Entity) ) and add or append it.
"Power Lens - Single Entity2": {
"name": "Change=Low",
"order": 100,
"queries": [
{
"boxTypeExpressions": {
"fc40ff80-42c1-47a2-a6fb-363ea23bb53a": "=="
},
"attributeExpression": {
"attributeType": "a33e72f8-e30f-488a-b4f6-aaeeb21556a5",
"operator": "!=",
"attributeValue": "Low"
},
"operator": "and",
"applyBoxVisibility": true,
"boxIsVisible": false,
"boxIsInLayout": true
}
]
},
We populated the Lens above with the following values, taken from Change Lens within the Business Function Box Type of the Default Illustration
| Reference Name | Description | Value used |
|---|---|---|
| Internal Power Lens menu name | The internal name for the Power Lens Menu | My Power Lens |
| Display Power Lens menu name | This actual Power Lens Menu that will appear in the Left Hand Menu under Power Lenses | My Power Lens Menu |
| Internal Name | The internal menu item name | Power Lens - Single Entity2 |
| Display Name | The actual menu item name that will appear in the Left Hand Menu | Change = Low |
| Box Type UUID | This is the UUID of the Box Type that contains the attribute you would like to create a lens for. | fc40ff80-42c1-47a2-a6fb-363ea23bb53a |
| Attribute UUID | This is the UUID of the Lens that you would like to perform a condition against | a33e72f8-e30f-488a-b4f6-aaeeb21556a5 |
| Attribute Operator | This is one of the operators <, <=, >, >=, !=, == | != |
| Attribute Value | This is the value that you would like to compare against. | True |
The addition of the new Power Lens, enriched the left hand menu to give the following:
Placing this text into the Power Lenses JSON Editor produces this left hand menu "Change=Low"
Example 3: Strategic & Change = Low
In this example we will use two lenses at the same time within the default Illustration where we will remove all boxes from the illustration that are not Strategic and where Change = Low. To start, we are going to use our Two Entities syntax. In the right hand menu, navigate to the JSON editor and click on the Power Lenses box and copy the Syntax from below ( based on [Two Entities](#Power Lens Syntax - Two Entities) ) and add or append it.
"Power Lens - 2 Entities": {
"name": "Strategic & Change=Low",
"order": 100,
"queries": [
{
"boxTypeExpressions": {
"fc40ff80-42c1-47a2-a6fb-363ea23bb53a": "=="
},
"attributeExpression": {
"attributeType": "1154c463-9474-448d-b477-b425e98d176c",
"operator": "!=",
"attributeValue": "True",
"children": [
{
"attributeType": "a33e72f8-e30f-488a-b4f6-aaeeb21556a5",
"operator": "!=",
"attributeValue": "Low"
}
],
"childrenOperator": "and",
"childrenExpressionOperator": "or"
},
"operator": "and",
"applyBoxVisibility": true,
"boxIsVisible": false,
"boxIsInLayout": true
}
]
},
We populated the Lens above with the following values, taken from Strategic Lens AND the Change Lens within the Business Function Box Type of the Default Illustration
| Reference Name | Description | Value used |
|---|---|---|
| Internal Power Lens menu name | The internal name for the Power Lens Menu | My Power Lens |
| Display Power Lens menu name | This actual Power Lens Menu that will appear in the Left Hand Menu under Power Lenses | My Power Lens Menu |
| Internal Name | The internal menu item name | Power Lens - 2 Entities |
| Display Name | The actual menu item name that will appear in the Left Hand Menu | Strategic & Change=Low |
| Box Type UUID | This is the UUID of the Box Type that contains the attribute you would like to create a lens for. | fc40ff80-42c1-47a2-a6fb-363ea23bb53a |
| Attribute UUID | This is the UUID of the Lens that you would like to perform a condition against | 1154c463-9474-448d-b477-b425e98d176c |
| Attribute Operator | This is one of the operators <, <=, >, >=, !=, == | != |
| Attribute Value | This is the value that you would like to compare against. | True |
| Attribute UUID 2 | This is the UUID of the Lens that you would like to perform a condition against | a33e72f8-e30f-488a-b4f6-aaeeb21556a5 |
| Attribute Operator 2 | This is one of the operators <, <=, >, >=, !=, == | != |
| Attribute Value 2 | This is the value that you would like to compare against. | Low |
The addition of the new Power Lens, enriched the left hand menu to give the following:
Placing this text into the Power Lenses JSON Editor produces this left hand menu Strategic & Change=Low
The completed JSON Syntax for all 3 (three) Power Lenses is listed below. It includes the two default Power Lenses, Is Canvas and Has Lens Pages
JSON Power Lens code
{
"Power Lens - Single Entity": {
"name": "Strategic",
"order": 100,
"queries": [
{
"boxTypeExpressions": {
"fc40ff80-42c1-47a2-a6fb-363ea23bb53a": "=="
},
"attributeExpression": {
"attributeType": "1154c463-9474-448d-b477-b425e98d176c",
"operator": "!=",
"attributeValue": "True"
},
"operator": "and",
"applyBoxVisibility": true,
"boxIsVisible": false,
"boxIsInLayout": true
}
]
},
"Power Lens - Single Entity2": {
"name": "Change=Low",
"order": 100,
"queries": [
{
"boxTypeExpressions": {
"fc40ff80-42c1-47a2-a6fb-363ea23bb53a": "=="
},
"attributeExpression": {
"attributeType": "a33e72f8-e30f-488a-b4f6-aaeeb21556a5",
"operator": "!=",
"attributeValue": "Low"
},
"operator": "and",
"applyBoxVisibility": true,
"boxIsVisible": false,
"boxIsInLayout": true
}
]
},
"Power Lens - 2 Entities": {
"name": "Strategic & Change=Low",
"order": 100,
"queries": [
{
"boxTypeExpressions": {
"fc40ff80-42c1-47a2-a6fb-363ea23bb53a": "=="
},
"attributeExpression": {
"attributeType": "1154c463-9474-448d-b477-b425e98d176c",
"operator": "!=",
"attributeValue": "True",
"children": [
{
"attributeType": "a33e72f8-e30f-488a-b4f6-aaeeb21556a5",
"operator": "!=",
"attributeValue": "Low"
}
],
"childrenOperator": "and",
"childrenExpressionOperator": "or"
},
"operator": "and",
"applyBoxVisibility": true,
"boxIsVisible": false,
"boxIsInLayout": true
}
]
},
"Is Canvas": {
"name": "Is Canvas",
"order": -1,
"queries": [
{
"attributeTypeExpressions": {
"Is Canvas": "=="
},
"attributeExpression": {
"attributeType": "Is Canvas",
"attributeValue": "True",
"attributeParameter": "",
"operator": "==",
"childrenOperator": "or",
"childrenExpressionOperator": "or"
},
"boxTypeExpressionOperator": "or",
"attributeTypeExpressionOperator": "or",
"boxExpressionOperator": "or",
"operator": "and",
"applyBoxTypeVisibility": false,
"boxTypeIsVisible": true,
"boxTypeAreBoxesVisible": true,
"boxTypeAreBoxesInLayout": true,
"boxTypeAttributeTypeVisibilityMap": {
"Is Canvas": true
},
"applyBoxVisibility": false,
"boxIsVisible": true,
"boxIsInLayout": true
}
]
},
"Has Lens Pages": {
"name": "Has Lens Pages",
"order": -1,
"queries": [
{
"attributeTypeExpressions": {
"Has Lens Pages": "=="
},
"attributeExpression": {
"attributeType": "Has Lens Pages",
"attributeValue": "True",
"attributeParameter": "",
"operator": "==",
"childrenOperator": "or",
"childrenExpressionOperator": "or"
},
"boxTypeExpressionOperator": "or",
"attributeTypeExpressionOperator": "or",
"boxExpressionOperator": "or",
"operator": "and",
"applyBoxTypeVisibility": false,
"boxTypeIsVisible": true,
"boxTypeAreBoxesVisible": true,
"boxTypeAreBoxesInLayout": true,
"boxTypeAttributeTypeVisibilityMap": {
"Has Lens Pages": true
},
"applyBoxVisibility": false,
"boxIsVisible": true,
"boxIsInLayout": true
}
]
}
}