Design Space Style
This commit is contained in:
1 parent
1c1b395254
commit
3eb034a93d
11 files changed
+346
-62
No files matched your search
+136
-1
@@ -12437,6 +12437,113 @@
|
||||
"propertyNameAtParent": "keys",
|
||||
"isPersonalData": true
|
||||
},
|
||||
{
|
||||
"type": "Design Space",
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "spaceStyle",
|
||||
"label": "Add Space Style",
|
||||
"relatedUiObject": "Space Style",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "spaceSettings",
|
||||
"label": "Add Space Settings",
|
||||
"relatedUiObject": "Space Settings",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
}
|
||||
],
|
||||
"isHierarchyHead": true,
|
||||
"addLeftIcons": true,
|
||||
"level": 0,
|
||||
"properties": [
|
||||
{
|
||||
"name": "spaceStyle",
|
||||
"type": "node",
|
||||
"childType": "Space Style",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "spaceSettings",
|
||||
"type": "node",
|
||||
"childType": "Space Settings",
|
||||
"autoAdd": true
|
||||
}
|
||||
],
|
||||
"icon": "bitcoin"
|
||||
},
|
||||
{
|
||||
"type": "Space Style",
|
||||
"level": 4,
|
||||
"propertyNameAtParent": "spaceStyle",
|
||||
"chainAttachesTo": {
|
||||
"compatibleTypes": "->Charting Space->Design Space->"
|
||||
},
|
||||
"editors": {
|
||||
"config": true
|
||||
},
|
||||
"initialValues": {
|
||||
"config": "{ \n\"backgroundColor\": \"UI_COLOR.BLACK\"\n}"
|
||||
},
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Configure",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"actionFunction": "payload.onMenuItemClick",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete",
|
||||
"iconPathOff": "delete"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
"icon": "bitcoin"
|
||||
},
|
||||
{
|
||||
"type": "Space Settings",
|
||||
"level": 4,
|
||||
"propertyNameAtParent": "spaceSettings",
|
||||
"chainAttachesTo": {
|
||||
"compatibleTypes": "->Charting Space->Design Space->"
|
||||
},
|
||||
"editors": {
|
||||
"config": true
|
||||
},
|
||||
"initialValues": {
|
||||
"config": "{ \n\"xxx\": \"\"\n}"
|
||||
},
|
||||
"menuItems": [
|
||||
{
|
||||
"action": "Configure",
|
||||
"actionFunction": "uiObject.configEditor.activate",
|
||||
"label": "Configure",
|
||||
"iconPathOn": "configuration",
|
||||
"iconPathOff": "configuration"
|
||||
},
|
||||
{
|
||||
"action": "Delete UI Object",
|
||||
"askConfirmation": true,
|
||||
"confirmationLabel": "Confirm to Delete",
|
||||
"actionFunction": "payload.onMenuItemClick",
|
||||
"label": "Delete",
|
||||
"iconPathOn": "delete",
|
||||
"iconPathOff": "delete"
|
||||
}
|
||||
],
|
||||
"addLeftIcons": true,
|
||||
"icon": "bitcoin"
|
||||
},
|
||||
{
|
||||
"type": "Charting Space",
|
||||
"menuItems": [
|
||||
@@ -12448,6 +12555,22 @@
|
||||
"relatedUiObject": "Viewport",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "spaceStyle",
|
||||
"label": "Add Space Style",
|
||||
"relatedUiObject": "Space Style",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"disableIfPropertyIsDefined": true,
|
||||
"propertyToCheckFor": "spaceSettings",
|
||||
"label": "Add Space Settings",
|
||||
"relatedUiObject": "Space Settings",
|
||||
"actionFunction": "payload.onMenuItemClick"
|
||||
},
|
||||
{
|
||||
"action": "Add UI Object",
|
||||
"label": "Add Dashboard",
|
||||
@@ -12474,6 +12597,18 @@
|
||||
"childType": "Viewport",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "spaceStyle",
|
||||
"type": "node",
|
||||
"childType": "Space Style",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "spaceSettings",
|
||||
"type": "node",
|
||||
"childType": "Space Settings",
|
||||
"autoAdd": true
|
||||
},
|
||||
{
|
||||
"name": "dashboards",
|
||||
"type": "array",
|
||||
@@ -14750,7 +14885,7 @@
|
||||
"incompatibleTypes": "->Tutorial->Tutorial Topic->Tutorial Step->"
|
||||
},
|
||||
"chainAttachesTo": {
|
||||
"compatibleTypes": "->Tutorial->"
|
||||
"compatibleTypes": "->Tutorial->Tutorial Topic->"
|
||||
},
|
||||
"addLeftIcons": true,
|
||||
"level": 1,
|
||||
|
||||
@@ -163,7 +163,7 @@ function newPlottersManager() {
|
||||
|
||||
let host = layer.networkNode.config.host
|
||||
let webPort = layer.networkNode.config.webPort
|
||||
if (host === undefined) { host = 'localhost' }
|
||||
if (host === undefined) { host = window.location.hostname }
|
||||
if (webPort === undefined) { webPort = window.location.port }
|
||||
|
||||
let eventsServerClient = canvas.designSpace.workspace.eventsServerClients.get(layer.networkNode.id)
|
||||
|
||||
@@ -15,6 +15,7 @@ function newWorkspace() {
|
||||
save: saveWorkspace,
|
||||
getHierarchyHeads: getHierarchyHeads,
|
||||
getHierarchyHeadsById: getHierarchyHeadsById,
|
||||
getHierarchyHeadsByType: getHierarchyHeadsByType,
|
||||
getNodeThatIsOnFocus: getNodeThatIsOnFocus,
|
||||
getNodeByShortcutKey: getNodeByShortcutKey,
|
||||
getNodeById: getNodeById,
|
||||
@@ -404,6 +405,16 @@ function newWorkspace() {
|
||||
}
|
||||
}
|
||||
|
||||
function getHierarchyHeadsByType(nodeType) {
|
||||
let hiriatchyHeads = getHierarchyHeads()
|
||||
for (let i = 0; i < hiriatchyHeads.length; i++) {
|
||||
let hiriatchyHead = hiriatchyHeads[i]
|
||||
if (hiriatchyHead.type === nodeType) {
|
||||
return hiriatchyHead
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function replaceWorkspaceByLoadingOne(name) {
|
||||
|
||||
let webCommand
|
||||
|
||||
@@ -215,6 +215,11 @@ function newCircularMenuItem() {
|
||||
}
|
||||
}
|
||||
iconPhysics()
|
||||
backgroundColorPhysics()
|
||||
}
|
||||
|
||||
function backgroundColorPhysics(){
|
||||
defaultBackgroudColor = canvas.floatingSpace.style.node.menuItem.backgroundColor
|
||||
}
|
||||
|
||||
function iconPhysics() {
|
||||
@@ -408,7 +413,7 @@ function newCircularMenuItem() {
|
||||
cornerRadius: 5,
|
||||
lineWidth: 0.1,
|
||||
container: thisObject.container,
|
||||
borderColor: UI_COLOR.DARK,
|
||||
borderColor: backgroundColor,
|
||||
backgroundColor: backgroundColor,
|
||||
castShadow: false,
|
||||
xOffset: 60
|
||||
@@ -455,7 +460,7 @@ function newCircularMenuItem() {
|
||||
}
|
||||
|
||||
let labelPoint
|
||||
let fontSize = 15
|
||||
let fontSize = canvas.floatingSpace.style.node.menuItem.fontSize
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
|
||||
|
||||
@@ -466,7 +471,7 @@ function newCircularMenuItem() {
|
||||
}
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
|
||||
browserCanvasContext.fillStyle = 'rgba(' + canvas.floatingSpace.style.node.menuItem.fontColor + ', 1)'
|
||||
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ function newFloatingObject() {
|
||||
isParentCollapsed: false,
|
||||
frozenManually: false,
|
||||
collapsedManually: false,
|
||||
typeStrokeStyle: undefined,
|
||||
nameStrokeStyle: undefined,
|
||||
forceFocus: forceFocus,
|
||||
removeForceFocus: removeForceFocus,
|
||||
setFocus: setFocus,
|
||||
@@ -76,6 +78,8 @@ function newFloatingObject() {
|
||||
thisObject.container.frame.radius = 0
|
||||
thisObject.container.frame.position.x = 0
|
||||
thisObject.container.frame.position.y = 0
|
||||
thisObject.typeStrokeStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
|
||||
thisObject.nameStrokeStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
|
||||
|
||||
let selfMouseOverEventSubscriptionId
|
||||
let selfMouseClickEventSubscriptionId
|
||||
@@ -83,7 +87,7 @@ function newFloatingObject() {
|
||||
let spaceFocusAquiredEventSubscriptionId
|
||||
let lastParentAngle
|
||||
let forcedFocusCounter = 0
|
||||
|
||||
|
||||
return thisObject
|
||||
|
||||
function finalize() {
|
||||
@@ -297,6 +301,20 @@ function newFloatingObject() {
|
||||
}
|
||||
positionContraintsPhysics()
|
||||
focusPhysics()
|
||||
syncStylePhysics()
|
||||
}
|
||||
|
||||
function syncStylePhysics() {
|
||||
if (thisObject.rawFontSize !== canvas.floatingSpace.style.node.fontSize) {
|
||||
thisObject.rawFontSize = canvas.floatingSpace.style.node.fontSize
|
||||
thisObject.targetFontSize = thisObject.rawFontSize * 1
|
||||
}
|
||||
if (thisObject.rawImageSize !== canvas.floatingSpace.style.node.imageSize) {
|
||||
thisObject.rawImageSize = canvas.floatingSpace.style.node.imageSize
|
||||
thisObject.targetImageSize = thisObject.rawImageSize * 1
|
||||
}
|
||||
thisObject.typeStrokeStyle = 'rgba(' + canvas.floatingSpace.style.node.type.fontColor + ', 1)'
|
||||
thisObject.nameStrokeStyle = 'rgba(' + canvas.floatingSpace.style.node.name.fontColor + ', 1)'
|
||||
}
|
||||
|
||||
function focusPhysics() {
|
||||
@@ -564,8 +582,6 @@ function newFloatingObject() {
|
||||
thisObject.payload.position.y = thisObject.container.frame.position.y
|
||||
}
|
||||
|
||||
|
||||
|
||||
function onMouseOver(point) {
|
||||
if (thisObject.isOnFocus === false) {
|
||||
setFocus(point)
|
||||
|
||||
@@ -1522,6 +1522,7 @@ function newUiObject() {
|
||||
/* Label Text */
|
||||
let labelPoint
|
||||
let fontSize = thisObject.payload.floatingObject.currentFontSize
|
||||
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
|
||||
let label
|
||||
|
||||
if (radius > 6) {
|
||||
@@ -1535,9 +1536,16 @@ function newUiObject() {
|
||||
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
|
||||
}
|
||||
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
|
||||
y: position.y + radius * 2 / 3 + fontSize * FONT_ASPECT_RATIO + 15
|
||||
if (thisObject.isOnFocus === true) {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
|
||||
y: position.y + radius * 2 / 3 + lineSeparator * 1 + 15
|
||||
}
|
||||
} else {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
|
||||
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 1
|
||||
}
|
||||
}
|
||||
|
||||
if (canvas.floatingSpace.inMapMode === true) {
|
||||
@@ -1551,7 +1559,7 @@ function newUiObject() {
|
||||
}
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
|
||||
browserCanvasContext.fillStyle = thisObject.payload.floatingObject.labelStrokeStyle
|
||||
browserCanvasContext.fillStyle = thisObject.payload.floatingObject.nameStrokeStyle
|
||||
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
|
||||
}
|
||||
}
|
||||
@@ -1593,10 +1601,11 @@ function newUiObject() {
|
||||
position = canvas.floatingSpace.transformPointToMap(position)
|
||||
}
|
||||
|
||||
let radius = thisObject.payload.floatingObject.container.frame.radius * 2.5
|
||||
let radius = thisObject.payload.floatingObject.container.frame.radius
|
||||
/* Label Text */
|
||||
let labelPoint
|
||||
let fontSize = thisObject.payload.floatingObject.currentFontSize * 3 / 4
|
||||
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
|
||||
let label
|
||||
|
||||
if (radius > 6) {
|
||||
@@ -1612,9 +1621,16 @@ function newUiObject() {
|
||||
fontSize = thisObject.payload.floatingObject.currentFontSize * 2 / 4
|
||||
}
|
||||
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
|
||||
y: position.y + radius * 2 / 5 + fontSize * FONT_ASPECT_RATIO + 10
|
||||
if (thisObject.isOnFocus === true) {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
|
||||
y: position.y + radius * 2 / 3 + lineSeparator * 5 + 15
|
||||
}
|
||||
} else {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
|
||||
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 5
|
||||
}
|
||||
}
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
|
||||
@@ -1646,10 +1662,11 @@ function newUiObject() {
|
||||
position = canvas.floatingSpace.transformPointToMap(position)
|
||||
}
|
||||
|
||||
let radius = thisObject.payload.floatingObject.container.frame.radius * 1.00
|
||||
let radius = thisObject.payload.floatingObject.container.frame.radius
|
||||
/* Label Text */
|
||||
let labelPoint
|
||||
let fontSize = thisObject.payload.floatingObject.currentFontSize * 8 / 7
|
||||
let fontSize = thisObject.payload.floatingObject.currentFontSize
|
||||
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
|
||||
let label
|
||||
|
||||
if (radius > 6) {
|
||||
@@ -1679,9 +1696,16 @@ function newUiObject() {
|
||||
labelPoint.x = labelPoint.x + radius * 7 / 3 * Math.cos(toRadians(thisObject.payload.angle))
|
||||
labelPoint.y = labelPoint.y + radius * 7 / 3 * Math.sin(toRadians(thisObject.payload.angle))
|
||||
} else {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
|
||||
y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
|
||||
if (thisObject.isOnFocus === true) {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
|
||||
y: position.y + radius * 2 / 3 + lineSeparator * 3 + 15
|
||||
}
|
||||
} else {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
|
||||
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1709,10 +1733,11 @@ function newUiObject() {
|
||||
position = canvas.floatingSpace.transformPointToMap(position)
|
||||
}
|
||||
|
||||
let radius = thisObject.payload.floatingObject.container.frame.radius * 1.30
|
||||
let radius = thisObject.payload.floatingObject.container.frame.radius
|
||||
/* Label Text */
|
||||
let labelPoint
|
||||
let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4
|
||||
let fontSize = thisObject.payload.floatingObject.currentFontSize
|
||||
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
|
||||
let label
|
||||
|
||||
if (radius > 6) {
|
||||
@@ -1725,9 +1750,16 @@ function newUiObject() {
|
||||
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
|
||||
}
|
||||
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
|
||||
y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
|
||||
if (thisObject.isOnFocus === true) {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
|
||||
y: position.y + radius * 2 / 3 + lineSeparator * 4 + 15
|
||||
}
|
||||
} else {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
|
||||
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 4
|
||||
}
|
||||
}
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
|
||||
@@ -1752,10 +1784,11 @@ function newUiObject() {
|
||||
position = canvas.floatingSpace.transformPointToMap(position)
|
||||
}
|
||||
|
||||
let radius = thisObject.payload.floatingObject.container.frame.radius * 0.8
|
||||
let radius = thisObject.payload.floatingObject.container.frame.radius
|
||||
/* Label Text */
|
||||
let labelPoint
|
||||
let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4 / 2
|
||||
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
|
||||
let label
|
||||
|
||||
if (radius > 6) {
|
||||
@@ -1768,9 +1801,16 @@ function newUiObject() {
|
||||
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
|
||||
}
|
||||
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
|
||||
y: position.y + radius * 7 / 5 + fontSize * FONT_ASPECT_RATIO + 15
|
||||
if (thisObject.isOnFocus === true) {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
|
||||
y: position.y + radius * 2 / 3 + lineSeparator * 2 + 15
|
||||
}
|
||||
} else {
|
||||
labelPoint = {
|
||||
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
|
||||
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 2
|
||||
}
|
||||
}
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
|
||||
@@ -1890,7 +1930,7 @@ function newUiObject() {
|
||||
browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS - 2, 0, Math.PI * 2, true)
|
||||
browserCanvasContext.closePath()
|
||||
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.BLACK + ', 1)'
|
||||
browserCanvasContext.fillStyle = 'rgba(' + canvas.floatingSpace.style.backgroundColor + ', 1)'
|
||||
|
||||
browserCanvasContext.fill()
|
||||
|
||||
@@ -1906,7 +1946,7 @@ function newUiObject() {
|
||||
browserCanvasContext.beginPath()
|
||||
browserCanvasContext.arc(visiblePosition.x, visiblePosition.y, VISIBLE_RADIUS, 0, Math.PI * 2, true)
|
||||
browserCanvasContext.closePath()
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.BLACK + ', 0.70)'
|
||||
browserCanvasContext.fillStyle = 'rgba(' + canvas.floatingSpace.style.backgroundColor + ', 0.70)'
|
||||
browserCanvasContext.fill()
|
||||
/* Border when node is in focus */
|
||||
if (
|
||||
|
||||
@@ -632,8 +632,6 @@ function newUiObjectConstructor() {
|
||||
|
||||
floatingObject.fillStyle = 'rgba(' + UI_COLOR.RED + ', 1)'
|
||||
}
|
||||
|
||||
floatingObject.labelStrokeStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
|
||||
}
|
||||
|
||||
function destroyUiObject(payload) {
|
||||
|
||||
@@ -207,8 +207,14 @@ function newUiObjectTitle() {
|
||||
const FRAME_HEIGHT = 25
|
||||
const Y_OFFSET = -20
|
||||
const FRAME_WIDTH = (title.length + 2) / 2 * thisObject.payload.floatingObject.currentFontSize * FONT_ASPECT_RATIO * 1.2 * 2
|
||||
thisObject.container.frame.position.x = 0 - FRAME_WIDTH / 2
|
||||
thisObject.container.frame.position.y = 0 - thisObject.container.frame.radius * 1 / 2 - thisObject.payload.floatingObject.currentFontSize * FONT_ASPECT_RATIO + Y_OFFSET - FRAME_HEIGHT
|
||||
|
||||
if (thisObject.isOnFocus === true) {
|
||||
thisObject.container.frame.position.x = 0 - FRAME_WIDTH / 2
|
||||
thisObject.container.frame.position.y = 0 - thisObject.container.frame.radius * 1 / 2 - thisObject.payload.floatingObject.currentFontSize * FONT_ASPECT_RATIO + Y_OFFSET - FRAME_HEIGHT
|
||||
} else {
|
||||
thisObject.container.frame.position.x = 0 - FRAME_WIDTH / 2
|
||||
thisObject.container.frame.position.y = 0 - thisObject.payload.floatingObject.currentImageSize / 2 - FRAME_HEIGHT
|
||||
}
|
||||
|
||||
thisObject.container.frame.width = FRAME_WIDTH
|
||||
thisObject.container.frame.height = FRAME_HEIGHT
|
||||
@@ -307,8 +313,8 @@ function newUiObjectTitle() {
|
||||
cornerRadius: 3,
|
||||
lineWidth: 0.1,
|
||||
container: thisObject.container,
|
||||
borderColor: UI_COLOR.BLACK,
|
||||
backgroundColor: UI_COLOR.BLACK,
|
||||
borderColor: canvas.floatingSpace.style.backgroundColor,
|
||||
backgroundColor: canvas.floatingSpace.style.backgroundColor,
|
||||
castShadow: false,
|
||||
opacity: 0.25
|
||||
}
|
||||
@@ -325,7 +331,7 @@ function newUiObjectTitle() {
|
||||
let label
|
||||
|
||||
if (radius > 6 && (thisObject.isOnFocus === true || thisObject.allwaysVisible === true || thisObject.isDefault === false)) {
|
||||
browserCanvasContext.strokeStyle = thisObject.payload.floatingObject.labelStrokeStyle
|
||||
browserCanvasContext.strokeStyle = thisObject.payload.floatingObject.typeStrokeStyle
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
|
||||
|
||||
@@ -355,7 +361,7 @@ function newUiObjectTitle() {
|
||||
}
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
|
||||
browserCanvasContext.fillStyle = thisObject.payload.floatingObject.labelStrokeStyle
|
||||
browserCanvasContext.fillStyle = thisObject.payload.floatingObject.typeStrokeStyle
|
||||
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ function newFloatingSpace() {
|
||||
inMapMode: false,
|
||||
drawReferenceLines: false,
|
||||
drawChainLines: true,
|
||||
style: undefined,
|
||||
toggleDrawChainLines: toggleDrawChainLines,
|
||||
toggleDrawReferenceLines: toggleDrawReferenceLines,
|
||||
toggleMapMode: toggleMapMode,
|
||||
@@ -63,6 +64,26 @@ function newFloatingSpace() {
|
||||
let onDragStartedEventSubscriptionId
|
||||
let spaceFocusAquiredEventSubscriptionId
|
||||
|
||||
/* Default Style */
|
||||
thisObject.style = {
|
||||
backgroundColor: UI_COLOR.BLACK,
|
||||
node: {
|
||||
imageSize: 96,
|
||||
fontSize: 18,
|
||||
type: {
|
||||
fontColor: UI_COLOR.WHITE
|
||||
},
|
||||
name: {
|
||||
fontColor: UI_COLOR.WHITE
|
||||
},
|
||||
menuItem: {
|
||||
backgroundColor: UI_COLOR.BLACK,
|
||||
fontColor: UI_COLOR.WHITE,
|
||||
fontSize: 15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function finalize() {
|
||||
@@ -385,11 +406,61 @@ function newFloatingSpace() {
|
||||
|
||||
function physics() {
|
||||
if (visible === false) { return }
|
||||
syncStylePhysics()
|
||||
browserZoomPhysics()
|
||||
positionContraintsPhysics()
|
||||
thisObject.floatingLayer.physics()
|
||||
}
|
||||
|
||||
function syncStylePhysics() {
|
||||
if (canvas.designSpace === undefined) { return }
|
||||
if (canvas.designSpace.workspace === undefined) { return }
|
||||
let designSpaceNode = canvas.designSpace.workspace.getHierarchyHeadsByType('Design Space')
|
||||
if (designSpaceNode === undefined) { return }
|
||||
if (designSpaceNode.spaceStyle === undefined) { return }
|
||||
try {
|
||||
configStyle = JSON.parse(designSpaceNode.spaceStyle.config)
|
||||
} catch (err) {
|
||||
if (thisObject.payload !== undefined) {
|
||||
thisObject.payload.uiObject.setErrorMessage(err.message)
|
||||
}
|
||||
return
|
||||
}
|
||||
if (configStyle.backgroundColor !== undefined) {
|
||||
thisObject.style.backgroundColor = eval(configStyle.backgroundColor)
|
||||
}
|
||||
if (configStyle.node !== undefined) {
|
||||
if (configStyle.node.fontSize !== undefined) {
|
||||
thisObject.style.node.fontSize = configStyle.node.fontSize
|
||||
}
|
||||
if (configStyle.node.imageSize !== undefined) {
|
||||
thisObject.style.node.imageSize = configStyle.node.imageSize
|
||||
}
|
||||
if (configStyle.node.name !== undefined) {
|
||||
if (configStyle.node.name.fontColor !== undefined) {
|
||||
thisObject.style.node.name.fontColor = eval(configStyle.node.name.fontColor)
|
||||
}
|
||||
}
|
||||
if (configStyle.node.type !== undefined) {
|
||||
if (configStyle.node.type.fontColor !== undefined) {
|
||||
thisObject.style.node.type.fontColor = eval(configStyle.node.type.fontColor)
|
||||
}
|
||||
}
|
||||
if (configStyle.node.menuItem !== undefined) {
|
||||
if (configStyle.node.menuItem.fontColor !== undefined) {
|
||||
thisObject.style.node.menuItem.fontColor = eval(configStyle.node.menuItem.fontColor)
|
||||
}
|
||||
if (configStyle.node.menuItem.backgroundColor !== undefined) {
|
||||
thisObject.style.node.menuItem.backgroundColor = eval(configStyle.node.menuItem.backgroundColor)
|
||||
}
|
||||
if (configStyle.node.menuItem.fontSize !== undefined) {
|
||||
thisObject.style.node.menuItem.fontSize = configStyle.node.menuItem.fontSize
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function positionContraintsPhysics() {
|
||||
if (thisObject.container.frame.position.x > 0) {
|
||||
thisObject.container.frame.position.x = 0
|
||||
@@ -425,7 +496,7 @@ function newFloatingSpace() {
|
||||
browserCanvasContext.beginPath()
|
||||
|
||||
browserCanvasContext.rect(thisObject.container.frame.position.x, thisObject.container.frame.position.y, thisObject.container.frame.width, thisObject.container.frame.height)
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.BLACK + ', 1)'
|
||||
browserCanvasContext.fillStyle = 'rgba(' + thisObject.style.backgroundColor + ', 1)'
|
||||
|
||||
browserCanvasContext.closePath()
|
||||
browserCanvasContext.fill()
|
||||
|
||||
@@ -965,35 +965,37 @@ function newTutorialSpace() {
|
||||
|
||||
|
||||
function findNextNode(node) {
|
||||
for (let i = 0; i < node.tutorialSteps.length; i++) {
|
||||
if (node.tutorialSteps !== undefined) {
|
||||
for (let i = 0; i < node.tutorialSteps.length; i++) {
|
||||
|
||||
let tutorialStep = node.tutorialSteps[i]
|
||||
if (found === true) {
|
||||
if (resumeModeActivated !== true) {
|
||||
currentNode = tutorialStep
|
||||
currentStatus = 'Playing Step'
|
||||
advanced = true
|
||||
navigationStack.push(currentNode)
|
||||
findTutorialNode(currentNode)
|
||||
return
|
||||
} else {
|
||||
let tutorial = {
|
||||
status: undefined
|
||||
}
|
||||
loadTutorial(tutorialStep.payload, tutorial)
|
||||
if (tutorial.status !== 'Done') {
|
||||
let tutorialStep = node.tutorialSteps[i]
|
||||
if (found === true) {
|
||||
if (resumeModeActivated !== true) {
|
||||
currentNode = tutorialStep
|
||||
currentStatus = 'Playing Step'
|
||||
advanced = true
|
||||
navigationStack.push(currentNode)
|
||||
findTutorialNode(currentNode)
|
||||
return
|
||||
} else {
|
||||
let tutorial = {
|
||||
status: undefined
|
||||
}
|
||||
loadTutorial(tutorialStep.payload, tutorial)
|
||||
if (tutorial.status !== 'Done') {
|
||||
currentNode = tutorialStep
|
||||
currentStatus = 'Playing Step'
|
||||
advanced = true
|
||||
navigationStack.push(currentNode)
|
||||
findTutorialNode(currentNode)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tutorialStep.id === currentNode.id) {
|
||||
found = true
|
||||
}
|
||||
if (tutorialStep.id === currentNode.id) {
|
||||
found = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < node.tutorialTopics.length; i++) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"type":"Workspace","name":"My Default Workspace","rootNodes":[{"type":"Network","name":"My Network","networkNodes":[{"type":"Network Node","name":"My Computer","config":"{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"8081\"\n}","dataMining":{"type":"Data Mining","name":"New Data Mining","exchangeDataTasks":[{"type":"Exchange Data Tasks","name":"Binance","marketDataTasks":[{"type":"Market Data Tasks","name":"Binance BTC/USDT","dataMineTasks":[{"type":"Data Mine Tasks","name":"Masters","taskManagers":[{"type":"Task Manager","name":"Masters","tasks":[{"type":"Task","name":"Exchange Raw Data","bot":{"type":"Sensor Bot Instance","name":"Exchange Raw Data","config":"{ \n\"startDate\": \"2020-01-01\"\n}","processes":[{"type":"Sensor Process Instance","name":"Exchange Raw Data Historic-OHLCVs","id":"d244c564-4e86-43c7-9796-dc3b6294ec8b","savedPayload":{"position":{"x":23350.72155964175,"y":27974.73694646384},"targetPosition":{"x":23796.134845502005,"y":28201.58542120731},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Historic-OHLCVs","id":"5eb11d6a-022e-4f60-97c4-d6cf90b249dc"}}}],"id":"343313ae-5705-484d-8bf8-aed25ba61cfa","savedPayload":{"position":{"x":23796.134845502005,"y":28201.58542120731},"targetPosition":{"x":24241.458369037155,"y":28428.234646351164},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"a8f38508-1cac-4ab1-815f-d338fc813377","savedPayload":{"position":{"x":24241.75852203732,"y":28428.208299607475},"targetPosition":{"x":24687.278008317153,"y":28654.76075777684},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Candles Volumes","bot":{"type":"Indicator Bot Instance","name":"Candles Volumes","config":"{}","processes":[{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Market","id":"f0ef12ed-f0fd-4b88-8e15-27cf24265a5f","savedPayload":{"position":{"x":24006.72050468727,"y":27369.71288635874},"targetPosition":{"x":24378.211094165374,"y":27704.217502769996},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","id":"9f683143-a33f-42c1-9fa8-c601f01ee4e1"}}},{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Daily","id":"7c8b312c-09bf-4c59-853f-1592391a9c57","savedPayload":{"position":{"x":24482.007917121682,"y":27215.198820322174},"targetPosition":{"x":24378.211094165374,"y":27704.217502769996},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Daily","id":"980ceb1d-7be6-454f-90d9-01ba1fd4a65d"}}}],"id":"8d58e84b-d7ef-464f-8079-0ec0887e3da3","savedPayload":{"position":{"x":24378.211094165374,"y":27704.217502769996},"targetPosition":{"x":24532.587246191903,"y":28179.44371808849},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"bf29e3bd-9386-408b-9091-042da0c53e81","savedPayload":{"position":{"x":24532.888249874817,"y":28179.42182195281},"targetPosition":{"x":24687.278008317153,"y":28654.76075777684},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Resistances and Supports","bot":{"type":"Indicator Bot Instance","name":"Resistances and Supports","config":"{}","processes":[{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Market","id":"a707814e-b81b-4102-9b5b-4e2fe969324f","savedPayload":{"position":{"x":25114.95430215858,"y":27265.22588761826},"targetPosition":{"x":25140.944779828777,"y":27764.465158604555},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","id":"5d9b2729-43fb-4e7e-aa4f-b8477c424e51"}}},{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Daily","id":"c5395fbe-4b5a-4492-a7fb-e2d259905e27","savedPayload":{"position":{"x":25560.208138746566,"y":27492.2415577616},"targetPosition":{"x":25140.944779828777,"y":27764.465158604555},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distLine truncated
|
||||
{"type":"Workspace","name":"My Default Workspace","rootNodes":[{"type":"Network","name":"My Network","networkNodes":[{"type":"Network Node","name":"My Computer","config":"{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"8081\"\n}","dataMining":{"type":"Data Mining","name":"New Data Mining","exchangeDataTasks":[{"type":"Exchange Data Tasks","name":"Binance","marketDataTasks":[{"type":"Market Data Tasks","name":"Binance BTC/USDT","dataMineTasks":[{"type":"Data Mine Tasks","name":"Masters","taskManagers":[{"type":"Task Manager","name":"Masters","tasks":[{"type":"Task","name":"Exchange Raw Data","bot":{"type":"Sensor Bot Instance","name":"Exchange Raw Data","config":"{ \n\"startDate\": \"2020-01-01\"\n}","processes":[{"type":"Sensor Process Instance","name":"Exchange Raw Data Historic-OHLCVs","id":"d244c564-4e86-43c7-9796-dc3b6294ec8b","savedPayload":{"position":{"x":23351.314277844434,"y":27974.785575589776},"targetPosition":{"x":23796.728123492587,"y":28201.627455815993},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":true},"referenceParent":{"type":"Process Definition","name":"Historic-OHLCVs","id":"5eb11d6a-022e-4f60-97c4-d6cf90b249dc"}}}],"id":"343313ae-5705-484d-8bf8-aed25ba61cfa","savedPayload":{"position":{"x":23796.728123492587,"y":28201.627455815993},"targetPosition":{"x":24242.102991685497,"y":28428.377563185066},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"a8f38508-1cac-4ab1-815f-d338fc813377","savedPayload":{"position":{"x":24242.102991685497,"y":28428.377563185066},"targetPosition":{"x":24687.607575835034,"y":28655.130355168047},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":true}}},{"type":"Task","name":"Candles Volumes","bot":{"type":"Indicator Bot Instance","name":"Candles Volumes","config":"{}","processes":[{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Market","id":"f0ef12ed-f0fd-4b88-8e15-27cf24265a5f","savedPayload":{"position":{"x":24007.267430337823,"y":27369.922290858955},"targetPosition":{"x":24378.75779785189,"y":27704.417915023907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":true},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","id":"9f683143-a33f-42c1-9fa8-c601f01ee4e1"}}},{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Daily","id":"7c8b312c-09bf-4c59-853f-1592391a9c57","savedPayload":{"position":{"x":24482.557214393688,"y":27215.410794575077},"targetPosition":{"x":24378.75779785189,"y":27704.417915023907},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":true},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Daily","id":"980ceb1d-7be6-454f-90d9-01ba1fd4a65d"}}}],"id":"8d58e84b-d7ef-464f-8079-0ec0887e3da3","savedPayload":{"position":{"x":24378.75779785189,"y":27704.417915023907},"targetPosition":{"x":24533.163695070733,"y":28179.720702819992},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"bf29e3bd-9386-408b-9091-042da0c53e81","savedPayload":{"position":{"x":24533.163695070733,"y":28179.720702819992},"targetPosition":{"x":24687.607575835034,"y":28655.130355168047},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":true}}},{"type":"Task","name":"Resistances and Supports","bot":{"type":"Indicator Bot Instance","name":"Resistances and Supports","config":"{}","processes":[{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Market","id":"a707814e-b81b-4102-9b5b-4e2fe969324f","savedPayload":{"position":{"x":25115.61142084002,"y":27265.367258518418},"targetPosition":{"x":25141.595034652833,"y":27764.590540263827},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":true},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","id":"5d9b2729-43fb-4e7e-aa4f-b8477c424e51"}}},{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Daily","id":"c5395fbe-4b5a-4492-a7fb-e2d259905e27","savedPayload":{"position":{"x":25560.869088302887,"y":27492.38766494412},"targetPosition":{"x":25141.595034652833,"y":27764.590540263827},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"Line truncated
|
||||
Reference in new issue
Block a user