Value at Angle Improvement

This commit is contained in:
Luis Fernando Molina committed 2021-06-03 20:59:53 +02:00
1 parent 60fdf78534
commit 8f50c4295b
9 files changed
+40 -30

No files matched your search

@@ -1,5 +1,5 @@
{
"type": "Asset Vote",
"type": "Asset Weight Vote",
"menuItems": [
{
"action": "Configure",
@@ -38,6 +38,6 @@
"referencingRules": {
"compatibleTypes": "->Asset Class->Asset->"
},
"propertyNameAtParent": "assetVotes",
"propertyNameAtParent": "assetWeightVotes",
"icon": "EN"
}
@@ -42,7 +42,9 @@
"initialValues": {
"config": "{\n\"codeName\": \"\"\n}"
},
"isTitleAllwaysVisible": false,
"attachingRules": {
"compatibleTypes": "->User Profile->"
},
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "contributionClaims",
@@ -1,5 +1,5 @@
{
"type": "Feature Vote",
"type": "Feature Weight Vote",
"menuItems": [
{
"action": "Configure",
@@ -37,6 +37,6 @@
"referencingRules": {
"compatibleTypes": "->Feature Class->Feature->"
},
"propertyNameAtParent": "featureVotes",
"propertyNameAtParent": "featureWeightVotes",
"icon": "github-api"
}
@@ -1,5 +1,5 @@
{
"type": "Position Vote",
"type": "Position Weight Vote",
"menuItems": [
{
"action": "Configure",
@@ -36,6 +36,6 @@
"referencingRules": {
"compatibleTypes": "->Team->Position->"
},
"propertyNameAtParent": "positionVotes",
"propertyNameAtParent": "positionWeightVotes",
"icon": "bitfinex"
}
@@ -1,5 +1,5 @@
{
"type": "User Vote",
"type": "User Vote Transfer",
"menuItems": [
{
"action": "Configure",
@@ -35,6 +35,6 @@
"referencingRules": {
"compatibleTypes": "->User Profile->"
},
"propertyNameAtParent": "userVotes",
"propertyNameAtParent": "userVoteTransfers",
"icon": "user-profile"
}
@@ -38,8 +38,9 @@
"initialValues": {
"config": "{\n\"codeName\": \"\"\n}"
},
"isTitleAllwaysVisible": false,
"isHierarchyHead": false,
"attachingRules": {
"compatibleTypes": "->User Profile->"
},
"addLeftIcons": true,
"level": 1,
"propertyNameAtParent": "votesDistribution",
@@ -17,20 +17,20 @@
{
"action": "Add UI Object",
"actionFunction": "payload.executeAction",
"label": "Add Position Vote",
"relatedUiObject": "Position Vote"
"label": "Add Position Weight Vote",
"relatedUiObject": "Position Weight Vote"
},
{
"action": "Add UI Object",
"actionFunction": "payload.executeAction",
"label": "Add Asset Vote",
"relatedUiObject": "Asset Vote"
"label": "Add Asset Weight Vote",
"relatedUiObject": "Asset Weight Vote"
},
{
"action": "Add UI Object",
"actionFunction": "payload.executeAction",
"label": "Add Feature Vote",
"relatedUiObject": "Feature Vote"
"label": "Add Feature Weight Vote",
"relatedUiObject": "Feature Weight Vote"
},
{
"action": "Add UI Object",
@@ -41,8 +41,8 @@
{
"action": "Add UI Object",
"actionFunction": "payload.executeAction",
"label": "Add User Vote",
"relatedUiObject": "User Vote"
"label": "Add User Vote Transfer",
"relatedUiObject": "User Vote Transfer"
},
{
"action": "Delete UI Object",
@@ -74,15 +74,15 @@
"autoAdd": false
},
{
"name": "assetVotes",
"name": "assetWeightVotes",
"type": "array",
"childType": "Asset Vote",
"childType": "Asset Weight Vote",
"autoAdd": false
},
{
"name": "featureVotes",
"name": "featureWeightVotes",
"type": "array",
"childType": "Feature Vote",
"childType": "Feature Weight Vote",
"autoAdd": false
},
{
@@ -92,15 +92,15 @@
"autoAdd": false
},
{
"name": "positionVotes",
"name": "positionWeightVotes",
"type": "array",
"childType": "Position Vote",
"childType": "Position Weight Vote",
"autoAdd": false
},
{
"name": "userVotes",
"name": "userVoteTransfers",
"type": "array",
"childType": "User Vote",
"childType": "User Vote Transfer",
"autoAdd": false
}
],
@@ -62,6 +62,7 @@ function newGovernanceUserProfileSpace() {
}
function resetVotingPower(node) {
if (node === undefined) { return }
if (node.payload === undefined) { return }
node.payload.votingPower = 0
/*
@@ -117,6 +118,7 @@ function newGovernanceUserProfileSpace() {
}
function distributeVotingPower(node, votingPower) {
if (node === undefined) { return }
if (node.payload === undefined) { return }
node.payload.votingPower = node.payload.votingPower + votingPower
drawVotingPower(node, node.payload.votingPower)
@@ -175,7 +177,11 @@ function newGovernanceUserProfileSpace() {
function drawVotingPower(node, votingPower) {
votingPower = new Intl.NumberFormat().format(votingPower) + ' ' + 'SA'
if (node.payload !== undefined) {
node.payload.uiObject.valueAtAngle = false
if (node.type === 'User Profile') {
return
}
node.payload.uiObject.valueAngleOffset = 180
node.payload.uiObject.valueAtAngle = true
node.payload.uiObject.setValue(votingPower)
}
}
@@ -29,6 +29,7 @@ function newUiObject() {
hasWarning: undefined,
hasInfo: undefined,
valueAtAngle: true,
valueAngleOffset: 0,
run: run,
stop: stop,
heartBeat: heartBeat,
@@ -1827,8 +1828,8 @@ function newUiObject() {
x: position.x - getTextWidth(label) / 2,
y: position.y
}
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))
labelPoint.x = labelPoint.x + radius * 7 / 3 * Math.cos(toRadians(thisObject.payload.angle + thisObject.valueAngleOffset))
labelPoint.y = labelPoint.y + radius * 7 / 3 * Math.sin(toRadians(thisObject.payload.angle + thisObject.valueAngleOffset))
} else {
if (thisObject.isOnFocus === true) {
labelPoint = {