Panel Improvements

This commit is contained in:
Luis Fernando Molina committed 2020-11-10 18:46:32 +01:00
1 parent 20fec1eccd
commit b820e165c4
13 files changed
+655 -64

No files matched your search

+3 -3
View File
@@ -49,12 +49,12 @@
style="overflow:hidden; background: url(Images/superalgos-platform.jpg); background-size: cover;"
onresize="onResize()">
<div id="contributors" class="credits">
<p>Superalgos is <span class="red">open-source</span> and <span class="red">free</span> thanks to the generosity of contributors:</p>
<p>Superalgos is <span class="red">free</span> and <span class="red">open-source</span>, and is <span class="red">constantly improving</span> thanks to the involvement of contributors:</p>
<p>Luis Fernando Molina, Julian Molina, Andreja Cobeljic, Matías Benitez, Ira Miller, Eduardo Remis,
Jeff Braun, rico4dev, 9808Bus, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Viktoria B., Guillermo V., Daniel J.,
Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Viktoria B., Guillermo V., Daniel J.,
Javier A., Gustavo J., Romina GS, Pedro P., Thais M., Andrey M., Loui M., Natalia M., Bashar A., Carlos V., Diego M.,
Sebastian E., Bogdan P., Marko V., Igor S., Niksa K., Rodrigo M., Nicanor M., Alejandro P., Mateo H., Lan T., Leon A., Uroš R., Filip M., Vladimir J. and Pavle B.</p>
<p><span class="red">Help us keep Superalgos free for all. Become a contributor!</span></p>
<p><span class="red">You too can help grow and improve Superalgos. Become a contributor!</span></p>
</div>
<div id="masterApp"></div>
<div id="canvasApp"></div>
+5
View File
@@ -123,4 +123,9 @@ function splitTextIntoPhrases(text, wordsPerLine) {
phrases.push(phrase)
}
return phrases
}
function getTextWidth(text) {
var metrics = browserCanvasContext.measureText(text);
return metrics.width;
}
@@ -4,14 +4,26 @@
"menuItems": [
{
"action": "Add UI Object",
"label": "Add Ethereum Blockchain",
"label": "Add Blockchain",
"relatedUiObject": "Ethereum Blockchain",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"label": "Add Decentralized Application",
"relatedUiObject": "Decentralized Application",
"relatedUiObject": "Ethereum Decentralized Application",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"label": "Add Token Definitions",
"relatedUiObject": "Ethereum Token Definitions",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"label": "Add Wallet",
"relatedUiObject": "Ethereum Wallet",
"actionFunction": "payload.executeAction"
},
{
@@ -31,6 +43,436 @@
"positionLocked": true,
"icon": "ethereum"
},
{
"type": "Ethereum Wallet",
"menuItems": [
{
"action": "Add UI Object",
"label": "Add Wallet Keys",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "walletKeys",
"relatedUiObject": "Wallet Keys",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"label": "Add Wallet Account",
"relatedUiObject": "Wallet Account",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"isHierarchyHead": true,
"addLeftIcons": true,
"level": 0,
"properties": [
{
"name": "walletKeys",
"type": "node",
"childType": "Wallet Keys",
"autoAdd": true
},
{
"name": "walletAccount",
"type": "array",
"childType": "Wallet Account"
}
],
"icon": "ethereum"
},
{
"type": "Wallet Keys",
"menuItems": [
{
"action": "Configure",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration",
"dontShowAtFullscreen": true,
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"editors": {
"config": true
},
"initialValues": {
"config": "{ \n\"privateKey\": \"\", \n\"publicKey\": \"\"\n}"
},
"addLeftIcons": true,
"level": 3,
"chainAttachesTo": {
"compatibleTypes": "->Ethereum Wallet->"
},
"propertyNameAtParent": "walletKeys",
"isPersonalData": true,
"icon": "ethereum"
},
{
"type": "Wallet Account",
"menuItems": [
{
"action": "Configure",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration",
"dontShowAtFullscreen": true,
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Add UI Object",
"label": "Add ETH Balance",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "ethBalance",
"relatedUiObject": "ETH Balance",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"label": "Add Token Balance",
"relatedUiObject": "Token Balance",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"editors": {
"config": true
},
"initialValues": {
"config": "{ \n\"value\": \"\"\n}"
},
"addLeftIcons": true,
"level": 3,
"chainAttachesTo": {
"compatibleTypes": "->Ethereum Wallet->"
},
"propertyNameAtParent": "walletAccount",
"properties": [
{
"name": "ethBalance",
"type": "node",
"childType": "ETH Balance"
},
{
"name": "tokenBalance",
"type": "array",
"childType": "Token Balance"
}
],
"icon": "ethereum"
},
{
"type": "ETH Balance",
"menuItems": [
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"addLeftIcons": true,
"level": 4,
"chainAttachesTo": {
"compatibleTypes": "->Wallet Account->"
},
"propertyNameAtParent": "ethBalance",
"icon": "ethereum"
},
{
"type": "Token Balance",
"menuItems": [
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"title": [
"Use Reference Parent"
],
"addLeftIcons": true,
"level": 4,
"referenceAttachesTo": {
"compatibleTypes": "->Ethereum Token->"
},
"chainAttachesTo": {
"compatibleTypes": "->Wallet Account->"
},
"propertyNameAtParent": "ethBalance",
"icon": "ethereum"
},
{
"type": "Ethereum Token Definitions",
"menuItems": [
{
"action": "Add Missing Children",
"label": "Add Missing Children",
"relatedUiObject": "Ethereum Token Definitions",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"isHierarchyHead": true,
"addLeftIcons": true,
"level": 0,
"properties": [
{
"name": "erc-20TokenType",
"type": "node",
"childType": "ERC-20 Token Type"
},
{
"name": "erc-223TokenType",
"type": "node",
"childType": "ERC-223 Token Type"
},
{
"name": "erc-721TokenType",
"type": "node",
"childType": "ERC-721 Token Type"
},
{
"name": "erc-777TokenType",
"type": "node",
"childType": "ERC-777 Token Type"
}
],
"icon": "ethereum"
},
{
"type": "ERC-20 Token Type",
"menuItems": [
{
"action": "Add UI Object",
"label": "Add Token Definition",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "ethereumToken",
"relatedUiObject": "Ethereum Token",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"addLeftIcons": true,
"level": 1,
"chainAttachesTo": {
"compatibleTypes": "->Ethereum Token Definitions->"
},
"propertyNameAtParent": "erc-720TokenType",
"properties": [
{
"name": "ethereumToken",
"type": "node",
"childType": "Ethereum Token"
}
],
"icon": "ethereum"
},
{
"type": "ERC-223 Token Type",
"menuItems": [
{
"action": "Add UI Object",
"label": "Add Token Definition",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "ethereumToken",
"relatedUiObject": "Ethereum Token",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"addLeftIcons": true,
"level": 1,
"chainAttachesTo": {
"compatibleTypes": "->Ethereum Token Definitions->"
},
"propertyNameAtParent": "erc-723TokenType",
"properties": [
{
"name": "ethereumToken",
"type": "node",
"childType": "Ethereum Token"
}
],
"icon": "ethereum"
},
{
"type": "ERC-721 Token Type",
"menuItems": [
{
"action": "Add UI Object",
"label": "Add Token Definition",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "ethereumToken",
"relatedUiObject": "Ethereum Token",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"addLeftIcons": true,
"level": 1,
"chainAttachesTo": {
"compatibleTypes": "->Ethereum Token Definitions->"
},
"propertyNameAtParent": "erc-721TokenType",
"properties": [
{
"name": "ethereumToken",
"type": "node",
"childType": "Ethereum Token"
}
],
"icon": "ethereum"
},
{
"type": "ERC-777 Token Type",
"menuItems": [
{
"action": "Add UI Object",
"label": "Add Token Definition",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "ethereumToken",
"relatedUiObject": "Ethereum Token",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"addLeftIcons": true,
"level": 1,
"chainAttachesTo": {
"compatibleTypes": "->Ethereum Token Definitions->"
},
"propertyNameAtParent": "erc-777TokenType",
"properties": [
{
"name": "ethereumToken",
"type": "node",
"childType": "Ethereum Token"
}
],
"icon": "ethereum"
},
{
"type": "Ethereum Token",
"menuItems": [
{
"action": "Configure",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration",
"dontShowAtFullscreen": true,
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Add UI Object",
"label": "Add Smart Contract",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "smartContract",
"relatedUiObject": "Smart Contract",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"editors": {
"config": true
},
"initialValues": {
"config": "{ \n\"codeName\": \"\"\n}"
},
"addLeftIcons": true,
"level": 2,
"chainAttachesTo": {
"compatibleTypes": "->ERC-20 Token Type->ERC-223 Token Type->ERC-721 Token Type->ERC-777 Token Type->"
},
"propertyNameAtParent": "ethereumToken",
"properties": [
{
"name": "smartContract",
"type": "node",
"childType": "Smart Contract"
}
],
"icon": "ethereum"
},
{
"type": "Ethereum Blockchain",
"menuItems": [
@@ -107,17 +549,6 @@
"dontShowAtFullscreen": true,
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Install Geth",
"actionProject": "Ethereum",
"label": "Install Geth",
"askConfirmation": true,
"confirmationLabel": "Confirm to Run",
"workDoneLabel": "Run Request Sent",
"iconPathOn": "run",
"iconPathOff": "run",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
@@ -143,7 +574,7 @@
"icon": "ethereum"
},
{
"type": "Decentralized Application",
"type": "Ethereum Decentralized Application",
"menuItems": [
{
"action": "Add UI Object",
@@ -176,6 +607,14 @@
{
"type": "Smart Contract",
"menuItems": [
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "smartContractAccount",
"label": "Add Smart Contract Account",
"relatedUiObject": "Smart Contract Account",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
@@ -194,10 +633,18 @@
"actionFunction": "payload.executeAction"
}
],
"chainAttachesTo": {
"compatibleTypes": "->Token Definition->Ethereum Decentralized Application->"
},
"propertyNameAtParent": "smartContracts",
"addLeftIcons": true,
"level": 1,
"properties": [
{
"name": "smartContractAccount",
"type": "node",
"childType": "Smart Contract Account"
},
{
"name": "solidityCode",
"type": "node",
@@ -206,6 +653,41 @@
],
"icon": "ethereum"
},
{
"type": "Smart Contract Account",
"menuItems": [
{
"action": "Configure",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration",
"dontShowAtFullscreen": true,
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete",
"iconPathOff": "delete",
"actionFunction": "payload.executeAction"
}
],
"editors": {
"config": true
},
"initialValues": {
"config": "{ \n\"value\": \"\"\n}"
},
"addLeftIcons": true,
"level": 3,
"chainAttachesTo": {
"compatibleTypes": "->Smart Contract->"
},
"propertyNameAtParent": "smartContractAccount",
"icon": "ethereum"
},
{
"type": "Solidity Code",
"menuItems": [
@@ -232,6 +714,9 @@
"initialValues": {
"code": "// Type your smart contract code here."
},
"chainAttachesTo": {
"compatibleTypes": "->Smart Contract->"
},
"propertyNameAtParent": "solidityCode",
"addLeftIcons": true,
"level": 2,
@@ -148,7 +148,7 @@ function newSuperalgosActionSwitch() {
break
case 'Add Missing Children':
{
functionLibraryUiObjectsFromNodes.addMissingChildren(action.node)
functionLibraryUiObjectsFromNodes.addMissingChildren(action.node, action.rootNodes)
}
break
case 'Delete UI Object':
@@ -24,6 +24,7 @@ function newNodeDeleter() {
}
function deleteUIObject(node, rootNodes) {
console.log('Deleting Node: ' + node.type + ' ' + node.name)
/* First we restore the reference parent to its default state */
if (node.payload !== undefined && node.payload.referenceParent !== undefined && node.payload.referenceParent.payload !== undefined && node.payload.referenceParent.payload.uiObject !== undefined) {
node.payload.referenceParent.payload.uiObject.isShowing = false
@@ -477,7 +477,7 @@ function newUiObjectsFromNodes() {
return object
}
function addMissingChildren(node) {
function addMissingChildren(node, rootNodes) {
let nodeDefinition = getNodeDefinition(node)
/* Connect to Parent */
@@ -488,7 +488,7 @@ function newUiObjectsFromNodes() {
if (property.type === 'node') {
if (property.name !== previousPropertyName) {
if (node[property.name] === undefined) {
addUIObject(node, property.childType)
addUIObject(node, property.childType, rootNodes)
previousPropertyName = property.name
}
}
@@ -1 +1 @@
{"type":"Trading Mine","name":"Masters","config":"{ \n\"codeName\": \"Masters\"\n}","project":"Superalgos","tradingBots":[{"type":"Trading Bot","name":"Low Frequency","config":"{\n\"codeName\": \"Low-Frequency\",\n\"repo\": \"Exchange-Raw-Data-Sensor-Bot\"\n}","project":"Superalgos","processes":[{"type":"Process Definition","name":"Trading","config":"{\n \"codeName\": \"Trading\",\n \"sessionRunWaitTime\": 5000,\n \"retryWaitTime\": 10000,\n \"framework\": {\n \"name\": \"Low-Frequency-Trading-Process\"\n }\n }","project":"Superalgos","processOutput":{"type":"Process Output","name":"New Process Output","project":"Superalgos","outputDatasets":[],"outputDatasetFolders":[{"type":"Output Dataset Folder","name":"Trading Engine","project":"Superalgos","outputDatasets":[],"outputDatasetFolders":[{"type":"Output Dataset Folder","name":"Episode","project":"Superalgos","outputDatasets":[{"type":"Output Dataset","name":"Multi-Period-Market Episode Counters","project":"Superalgos","id":"ec8d74ba-a4ad-417a-b479-6bae95b8a1fe","savedPayload":{"position":{"x":24910.97457254189,"y":18457.46644293786},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"3ed03a02-381d-43fe-9faa-761728c53bd8"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Counters","project":"Superalgos","id":"22b0af33-8c2f-4194-839b-affd18f298d5","savedPayload":{"position":{"x":24834.601232363748,"y":18490.07023931273},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"15f5b150-f1cf-403c-8cb9-2c7c4e1db8e8"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Statistics","project":"Superalgos","id":"23ab91ae-2e78-4993-bb69-855f69cef1ce","savedPayload":{"position":{"x":24753.53736157276,"y":18508.085329665024},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"fc9dc0f7-35e0-4548-bb91-f920825d694f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Statistics","project":"Superalgos","id":"d0a4515a-279d-4c27-8de2-168108861242","savedPayload":{"position":{"x":24670.543493063306,"y":18510.89823169951},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"91953362-8751-4440-a898-21245cd47c15"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Candle","project":"Superalgos","id":"7fc80977-5b37-413e-8107-0a89a16e08b0","savedPayload":{"position":{"x":24588.445883487308,"y":18498.413155411115},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"17fb41f5-61b5-4433-9a10-950ff8216a7e"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Candle","project":"Superalgos","id":"a6888750-1043-420c-9253-633e1399c5e4","savedPayload":{"position":{"x":24510.040268473647,"y":18471.05526509864},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"bbc9467d-28bf-432b-9e49-582d1bcabfb9"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Balances","project":"Superalgos","id":"0ad114df-f076-4a86-8c62-4c4a146da73c","savedPayload":{"position":{"x":24437.996657204443,"y":18429.756200904503},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"acddff59-b51b-4b45-b58f-71d4077755ee"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Balances","project":"Superalgos","id":"04b51302-957d-4365-ad55-9f89d60e261c","savedPayload":{"position":{"x":24374.76840845468,"y":18375.922352927064},"targetPosition":{"x":24696.86240363471,"y":18061.6685410663Line truncated
{"type":"Trading Mine","name":"Masters","config":"{ \n\"codeName\": \"Masters\"\n}","project":"Superalgos","tradingBots":[{"type":"Trading Bot","name":"Low Frequency","config":"{\n\"codeName\": \"Low-Frequency\",\n\"repo\": \"Exchange-Raw-Data-Sensor-Bot\"\n}","project":"Superalgos","processes":[{"type":"Process Definition","name":"Trading","config":"{\n \"codeName\": \"Trading\",\n \"sessionRunWaitTime\": 5000,\n \"retryWaitTime\": 10000,\n \"framework\": {\n \"name\": \"Low-Frequency-Trading-Process\"\n }\n }","project":"Superalgos","processOutput":{"type":"Process Output","name":"New Process Output","project":"Superalgos","outputDatasets":[],"outputDatasetFolders":[{"type":"Output Dataset Folder","name":"Trading Engine","project":"Superalgos","outputDatasets":[],"outputDatasetFolders":[{"type":"Output Dataset Folder","name":"Episode","project":"Superalgos","outputDatasets":[{"type":"Output Dataset","name":"Multi-Period-Market Episode Counters","project":"Superalgos","id":"ec8d74ba-a4ad-417a-b479-6bae95b8a1fe","savedPayload":{"position":{"x":24910.97457254189,"y":18457.46644293786},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"3ed03a02-381d-43fe-9faa-761728c53bd8"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Counters","project":"Superalgos","id":"22b0af33-8c2f-4194-839b-affd18f298d5","savedPayload":{"position":{"x":24834.601232363748,"y":18490.07023931273},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"15f5b150-f1cf-403c-8cb9-2c7c4e1db8e8"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Statistics","project":"Superalgos","id":"23ab91ae-2e78-4993-bb69-855f69cef1ce","savedPayload":{"position":{"x":24753.53736157276,"y":18508.085329665024},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"fc9dc0f7-35e0-4548-bb91-f920825d694f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Statistics","project":"Superalgos","id":"d0a4515a-279d-4c27-8de2-168108861242","savedPayload":{"position":{"x":24670.543493063306,"y":18510.89823169951},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"91953362-8751-4440-a898-21245cd47c15"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Candle","project":"Superalgos","id":"7fc80977-5b37-413e-8107-0a89a16e08b0","savedPayload":{"position":{"x":24588.445883487308,"y":18498.413155411115},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"17fb41f5-61b5-4433-9a10-950ff8216a7e"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Candle","project":"Superalgos","id":"a6888750-1043-420c-9253-633e1399c5e4","savedPayload":{"position":{"x":24510.040268473647,"y":18471.05526509864},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"bbc9467d-28bf-432b-9e49-582d1bcabfb9"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Balances","project":"Superalgos","id":"0ad114df-f076-4a86-8c62-4c4a146da73c","savedPayload":{"position":{"x":24437.996657204443,"y":18429.756200904503},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"acddff59-b51b-4b45-b58f-71d4077755ee"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Balances","project":"Superalgos","id":"04b51302-957d-4365-ad55-9f89d60e261c","savedPayload":{"position":{"x":24374.76840845468,"y":18375.922352927064},"targetPosition":{"x":24696.86240363471,"y":18061.6685410663Line truncated
@@ -266,7 +266,7 @@ function newSuperalgosCockpitSpace() {
x: thisObject.container.frame.width / 2,
y: thisObject.container.frame.height / 2 + 5
}
UI.projects.superalgos.utilities.drawPrint.printLabel(statusText, position.x, position.y, 1, 15, textColor, true, thisObject.container)
UI.projects.superalgos.utilities.drawPrint.printLabel(statusText, position.x, position.y, 1, 15, textColor, 'Center', thisObject.container)
}
if (UI.projects.superalgos.spaces.designSpace !== undefined) {
@@ -237,26 +237,32 @@ function newWorkspace() {
switch (workingAtTask) {
case 1:
console.log('Replacing Workspace Procedure Started')
console.log('Deleting Workspace')
UI.projects.superalgos.spaces.tutorialSpace.stop()
executeAction({ node: thisObject.workspaceNode, name: 'Delete Workspace', project: 'Superalgos' })
workingAtTask++
break
case 2:
console.log('Closing Events Server')
finalizeEventsServerClients()
thisObject.eventsServerClients = new Map()
workingAtTask++
break
case 3:
console.log('Stopping Automatic Saving')
clearInterval(savingWorkspaceIntervalId)
workingAtTask++
break
case 4:
console.log('Loading new Workspace')
thisObject.workspaceNode = loadedWorkspaceNode
thisObject.workspaceNode.project = 'Superalgos'
loadedWorkspaceNode = undefined
workingAtTask++
break
case 5:
console.log('Setting up Workspace')
executeAction({ node: thisObject.workspaceNode, name: 'Recreate Workspace', project: 'Superalgos', callBackFunction: finishInitialization })
function finishInitialization() {
setupEventsServerClients()
@@ -265,10 +271,12 @@ function newWorkspace() {
workingAtTask++
break
case 6:
console.log('Resetting Spaces')
UI.projects.superalgos.spaces.chartingSpace.reset()
workingAtTask++
break
case 7:
console.log('Replacing Workspace Procedure Finished')
workingAtTask = 0
circularProgressBar.visible = false
break
@@ -1573,6 +1573,8 @@ function newUiObject() {
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (radius > 6) {
const MAX_LABEL_LENGTH = 30
@@ -1588,15 +1590,19 @@ function newUiObject() {
return
}
}
if (label.length > MAX_LABEL_LENGTH) {
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
}
}
if (label.length > MAX_LABEL_LENGTH) {
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
}
if (thisObject.isOnFocus === true) {
if (label.length > MAX_LABEL_LENGTH) {
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
}
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
x: position.x - getTextWidth(label) / 2,
y: position.y + radius * 2 / 3 + lineSeparator * 1 + 30
}
} else {
@@ -1606,7 +1612,7 @@ function newUiObject() {
for (let i = 0; i < phrases.length; i++) {
let phrase = phrases[i]
labelPoint = {
x: position.x - phrase.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
x: position.x - getTextWidth(phrase) / 2,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * (1 + i)
}
if (UI.projects.superalgos.spaces.floatingSpace.inMapMode === false) {
@@ -1619,12 +1625,12 @@ function newUiObject() {
}
if (UI.projects.superalgos.spaces.floatingSpace.inMapMode === true) {
labelPoint.x = position.x - getTextWidth(label) / 2,
labelPoint.y = position.y + 50 / 2 + lineSeparator * 2
}
printMessage(label)
function printMessage(text) {
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = thisObject.payload.floatingObject.nameStrokeStyle
browserCanvasContext.fillText(text, labelPoint.x, labelPoint.y)
}
@@ -1679,6 +1685,8 @@ function newUiObject() {
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (radius > 6) {
const IDEAL_LABEL_LENGTH = 80
@@ -1699,7 +1707,7 @@ function newUiObject() {
for (let i = 0; i < phrases.length; i++) {
let phrase = phrases[i]
labelPoint = {
x: position.x - phrase.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
x: position.x - getTextWidth(phrase) / 2,
y: position.y + lineSeparator * (6 - phrases.length + 1 + i) + 30
}
printMessage(phrase)
@@ -1707,7 +1715,7 @@ function newUiObject() {
} else {
if (label.length < 50) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
x: position.x - getTextWidth(label) / 2,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 6
}
printMessage(label)
@@ -1715,8 +1723,6 @@ function newUiObject() {
}
function printMessage(text) {
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = 'rgba(' + textColor + ', 1)'
browserCanvasContext.fillText(text, labelPoint.x, labelPoint.y)
}
@@ -1752,6 +1758,8 @@ function newUiObject() {
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (radius > 6) {
const MAX_LABEL_LENGTH = 65
@@ -1773,7 +1781,7 @@ function newUiObject() {
if (thisObject.valueAtAngle === true && thisObject.payload.angle !== undefined) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
x: position.x - getTextWidth(label) / 2,
y: position.y
}
labelPoint.x = labelPoint.x + radius * 7 / 3 * Math.cos(toRadians(thisObject.payload.angle))
@@ -1781,18 +1789,17 @@ function newUiObject() {
} else {
if (thisObject.isOnFocus === true) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
x: position.x - getTextWidth(label) / 2,
y: position.y + radius * 2 / 3 + lineSeparator * 4 + 30
}
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
x: position.x - getTextWidth(label) / 2,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 4
}
}
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)'
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
@@ -1823,6 +1830,8 @@ function newUiObject() {
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (radius > 6) {
const MAX_LABEL_LENGTH = 65
@@ -1834,17 +1843,16 @@ function newUiObject() {
if (thisObject.isOnFocus === true) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
x: position.x - getTextWidth(label) / 2,
y: position.y + radius * 2 / 3 + lineSeparator * 5 + 30
}
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
x: position.x - getTextWidth(label) / 2,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 5
}
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)'
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
@@ -1873,6 +1881,8 @@ function newUiObject() {
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (radius > 6) {
const MAX_LABEL_LENGTH = 100
@@ -1885,17 +1895,16 @@ function newUiObject() {
if (thisObject.isOnFocus === true) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
x: position.x - getTextWidth(label) / 2,
y: position.y + radius * 2 / 3 + lineSeparator * 3 + 30
}
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
x: position.x - getTextWidth(label) / 2,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 3
}
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TITANIUM_YELLOW + ', 1)'
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
@@ -316,6 +316,8 @@ function newUiObjectTitle() {
let fontSize = thisObject.payload.floatingObject.currentFontSize
let label
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (radius > 6 && (thisObject.isOnFocus === true || thisObject.allwaysVisible === true || thisObject.isDefault === false)) {
browserCanvasContext.strokeStyle = thisObject.payload.floatingObject.typeStrokeStyle
@@ -327,7 +329,7 @@ function newUiObjectTitle() {
label = trimTitle(label)
labelPoint = {
x: -5,
x: 0,
y: thisObject.container.frame.height * 0.8
}
@@ -335,7 +337,7 @@ function newUiObjectTitle() {
if (UI.projects.superalgos.spaces.floatingSpace.inMapMode === true) {
labelPoint = UI.projects.superalgos.spaces.floatingSpace.transformPointToMap(labelPoint)
labelPoint.x = labelPoint.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO
labelPoint.x = labelPoint.x - getTextWidth(label) / 2,
labelPoint.y = labelPoint.y - 35
let nodeDefinition = getNodeDefinition(thisObject.payload.node)
@@ -366,7 +368,7 @@ function newUiObjectTitle() {
for (let i = 0; i < phrases.length; i++) {
let phrase = phrases[i]
let point = {
x: labelPoint.x - phrase.length / 2 * fontSize * FONT_ASPECT_RATIO + FRAME_WIDTH / 2 - 5,
x: labelPoint.x - getTextWidth(phrase) / 2 + FRAME_WIDTH / 2,
y: labelPoint.y - lineSeparator * (phrases.length - 1 - i)
}
@@ -375,7 +377,6 @@ function newUiObjectTitle() {
}
}
function printMessage(text, position) {
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = thisObject.payload.floatingObject.nameStrokeStyle
browserCanvasContext.fillText(text, position.x, position.y)
}
@@ -93,7 +93,8 @@ function newPlotterPanel() {
const frameBodyHeight = thisObject.container.frame.getBodyHeight()
const frameTitleHeight = thisObject.container.frame.height - frameBodyHeight
const X_AXIS = thisObject.container.frame.width / 2
const X_AXIS_A = thisObject.container.frame.width * 7 / 8
const X_AXIS_B = thisObject.container.frame.width * 7 / 8
const Y_AXIS = frameTitleHeight + frameBodyHeight / 2
const PANEL_HEIGHT = UI_PANEL.HEIGHT.NORMAL
@@ -168,7 +169,7 @@ function newPlotterPanel() {
let opacity = '1.00'
let fontSize = 14
let paletteColor
let paletteColor
if (panelData.textStyle !== undefined) {
if (panelData.textStyle.config.fontSize !== undefined) { fontSize = panelData.textStyle.config.fontSize }
@@ -176,8 +177,8 @@ function newPlotterPanel() {
if (panelData.textStyle.config.paletteColor !== undefined) { paletteColor = eval(panelData.textStyle.config.paletteColor) }
}
UI.projects.superalgos.utilities.drawPrint.printLabel(labelText, X_AXIS, UI_PANEL.HEIGHT.NORMAL * labelPosition / 100 / heightFactor, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction)
UI.projects.superalgos.utilities.drawPrint.printLabel(value, X_AXIS, UI_PANEL.HEIGHT.NORMAL * valuePosition / 100 / heightFactor, opacity, fontSize, paletteColor, true, thisObject.container, thisObject.fitFunction, false, true)
UI.projects.superalgos.utilities.drawPrint.printLabel(labelText, X_AXIS_A, UI_PANEL.HEIGHT.NORMAL * labelPosition / 100 / heightFactor, '0.60', undefined, undefined, 'Right', thisObject.container, thisObject.fitFunction)
UI.projects.superalgos.utilities.drawPrint.printLabel(value, X_AXIS_B, UI_PANEL.HEIGHT.NORMAL * valuePosition / 100 / heightFactor, opacity, fontSize, paletteColor, 'Right', thisObject.container, thisObject.fitFunction, false, true, undefined, true)
}
}
}
@@ -186,15 +186,34 @@ function newSuperalgosUtilitiesDrawPrint() {
browserCanvasContext.fill()
}
function printLabel(labelToPrint, x, y, opacity, fontSize, color, center, container, fitFunction, noDecimals, fixedDecimals, minDecimals) {
if (labelToPrint === undefined) { return }
function printLabel(
labelToPrint,
x,
y,
opacity,
fontSize,
color,
align,
container,
fitFunction,
noDecimals,
fixedDecimals,
minDecimals,
simulateMonospace
) {
let isItANumber
let labelPoint
let label = labelToPrint
if (labelToPrint === undefined) { return }
if (color === undefined) { color = UI_COLOR.DARK }
if (fontSize === undefined) { fontSize = 10 };
if (fontSize === undefined) { fontSize = 10 }
if (isNaN(label) === false && label !== '') { isItANumber = true }
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
let label = labelToPrint
if (isNaN(label) === false && label !== '') {
if (isItANumber === true) {
if (fixedDecimals !== true) {
label = dynamicDecimals(labelToPrint, minDecimals)
}
@@ -204,14 +223,36 @@ function newSuperalgosUtilitiesDrawPrint() {
}
}
let xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO
if (center === true) {
labelPoint = {
x: x - xOffset,
y: y
switch (align) {
case 'Center': {
labelPoint = {
x: x - getTextWidth(label) / 2,
y: y
}
break
}
} else {
case 'Left': {
labelPoint = {
x: x,
y: y
}
break
}
case 'Right': {
labelPoint = {
x: x - getTextWidth(label),
y: y
}
break
}
default: {
labelPoint = {
x: x,
y: y
}
}
}
if (isItANumber === true && simulateMonospace === true) {
labelPoint = {
x: x,
y: y
@@ -226,7 +267,47 @@ function newSuperalgosUtilitiesDrawPrint() {
labelPoint = fitFunction(labelPoint)
}
browserCanvasContext.fillStyle = 'rgba(' + color + ', ' + opacity + ')'
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
if (isItANumber === true && simulateMonospace === true) {
let isDecimal = false
let hasDecimals
let decimalCounter = 0
let characterOpacity = opacity
let insignificantZeroPossible = true
if (label.indexOf('.') >= 0) {
hasDecimals = true
isDecimal = true
}
for (let i = 0; i < label.length; i++) {
let character = label[label.length - 1 - i]
if (hasDecimals === true && character === '.') {
isDecimal = false
}
if (hasDecimals === true && character === '0' && insignificantZeroPossible === true) {
characterOpacity = opacity / 4
} else {
insignificantZeroPossible = false
characterOpacity = opacity
}
labelPoint.x = labelPoint.x - fontSize * FONT_ASPECT_RATIO * 1.5
browserCanvasContext.fillStyle = 'rgba(' + color + ', ' + characterOpacity + ')'
browserCanvasContext.fillText(character, labelPoint.x, labelPoint.y)
if (isDecimal === true) {
decimalCounter++
if (decimalCounter === 5) {
labelPoint.x = labelPoint.x - fontSize * FONT_ASPECT_RATIO * 1.5 / 2
}
}
}
}
else {
browserCanvasContext.fillStyle = 'rgba(' + color + ', ' + opacity + ')'
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
}
}