Use Variables for spaces between objects

This commit is contained in:
Lorenz Padberg 2022-08-10 10:16:57 +02:00
parent c7622f7ed6
commit 16b87380d8
1 changed files with 5 additions and 6 deletions

View File

@ -51,7 +51,7 @@ export default {
type: Number,
},
vertical: {
default: true,
default: false,
type: Boolean
}
},
@ -172,12 +172,12 @@ export default {
.text((d) => d.title)
.attr('class', 'circlesText text-xl font-bold hidden lg:block')
const topicHeigtOffset = 20
const topicHeightOffset = 20
const topicHeight = 35
const circleHeigth = circleWidth + 20
function getTopicPosition(i, d, topics) {
let pos = topicHeigtOffset
let pos = topicHeightOffset
for (let index = 0; index < i; index++) {
let topic = topics[index]
@ -186,12 +186,11 @@ export default {
}
pos += circleHeigth * topic.circles.length
}
return pos + 20
return pos + topicHeightOffset
}
function getCircleVerticalPostion(i, d, topics) {
let y = circleHeigth / 2 + topicHeigtOffset
let y = circleHeigth / 2 + topicHeightOffset + 10
for (let topic_index = 0; topic_index < topics.length; topic_index++) {
const topic = topics[topic_index]
console.log(topic.title)