Available translations
loading results
Style Condition
A style condition is a rule that allows applying an alternative style in cases where the rule validates true.
Style Condition - это правило, которое позволяет применять альтернативный стиль в случаях, когда правило является истинным.
Content
Style conditions offer a way to introduce additional intelligence on the visual representation of data by using styles that respond to certain conditions.
Условия стиля дают возможность привнести дополнительный смысл в визуальное представление данных, используя стили, которые реагируют на определенные условия.
For example, the Percentage Bandwidth plotter module assigns a different color to the Moving Average line when it's going up or down.
Например, модуль плоттера Percentage Bandwidth присваивает другой цвет линии Moving Average, когда она идет вверх или вниз.
To do that, a style condition features it's own style so that, when the condition validates
true
, the new style is applied. Для этого условие стиля включает свой собственный стиль, чтобы при подтверждении истинности условия применялся новый стиль.
Style conditions me be created in a sequence so that the style may continue changing upon the validation of a series of style conditions. The system evaluates all style conditions in a sequential order determined by their position in the rotational symmetry around the parent node. Each condition that is met may modify or add up to the resulting style that is rendered on screen. That is, the final style is the result of the sequential application of the styles defined for each condition that is met, on top of the default style.
Условия стиля могут быть созданы в последовательности, чтобы стиль мог продолжать изменяться после подтверждения ряда условий стиля. Система оценивает все условия стиля в последовательном порядке, определяемом их положением во вращательной симметрии вокруг родительского узла. Каждое выполненное условие может изменить или дополнить результирующий стиль, который отображается на экране. То есть, конечный стиль является результатом последовательного применения стилей, определенных для каждого выполненного условия, поверх стиля по умолчанию.
Configuring
Style Condition Configuration
Конфигурация Style Condition
Style conditions work pretty much like conditions used on trading systems. The main difference is that the variables available are solely those provided by the bot product definition that reference the corresponding plotter module.
Условия стиля работают практически так же, как условия, используемые в торговых системах. Основное отличие заключается в том, что доступными переменными являются только те, которые предусмотрены определением продукта Product Definition бота, ссылающегося на соответствующий модуль плоттера Plotter Module.
To continue the example of the Percentage Bandwidth plotter, the following is the condition that determines the newly added styles:
Чтобы продолжить пример с плоттером Percentage Bandwidth, ниже приведено условие, определяющее новые дополнительные стили:
record.previous.movingAverage > record.movingAverage
As hinted earlier, when the condition is met, the default style is modified by a second style that may be created on the menu of the style condition node.
Как уже говорилось ранее, при выполнении условия стиль по умолчанию модифицируется вторым стилем, который может быть создан в меню узла Style Condition.
The definition of secondary styles is slightly different from that of the default style, as—in such cases—the
atMousePosition
property may no longer be defined: Определение дополнительных стилей несколько отличается от определения стиля по умолчанию, поскольку в таких случаях свойство
atMousePosition
может быть не определено: {
"opacity": 0.55,
"lineWidth": 1,
"lineDash": [0,0],
"paletteColor": "UI_COLOR.RED"
}
Style Condition Menu
The Style Condition node has the following Node Menu items:
The Edit menu item has the following properties:
- action: Edit
- actionFunction:
uiObject.codeEditor.activate
- label: Edit
- iconPathOn: javascript-code
- iconPathOff: javascript-code
The Add Style menu item has the following properties:
- action: Add UI Object
- disableIfPropertyIsDefined: true
- propertyToCheckFor: style
- actionFunction:
payload.executeAction
- label: Add Style
- relatedUiObject: Style
- actionProject: Visual-Scripting
- relatedUiObjectProject: Foundations
The Delete menu item has the following properties:
- action: Delete UI Object
- actionProject: Visual-Scripting
- askConfirmation: true
- confirmationLabel: Confirm to Delete
- actionFunction:
payload.executeAction
- label: Delete
- iconPathOn: delete-entity
- iconPathOff: delete-entity
Tip: When a menu item is grayed out, it means that Style Condition already has the required child type that the menu item may add, and only that child is allowed for that case.
Style Condition Children
The Style Condition node has the following childrenNodesProperties:
The Style node property features the following properties:
- name: style
- type: node
- childType: Style
- autoAdd: true
Style Condition Attaching Rules
The following are the Node Attaching Rules that govern the attachment of Style Condition with other nodes:
Compatible Types:
Style Condition Code
This section explores Style Condition Node Code.
Initial Value
The initial value for Style Condition Code is:
""
Examples
This is a list of examples used on the Style Condition code, collected from this workspace.