removed last arrow
This commit is contained in:
parent
9319aa2b16
commit
463fd5eee7
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import * as d3 from "d3";
|
import * as d3 from "d3";
|
||||||
import {computed,ref, onMounted} from "vue";
|
import {onMounted, ref} from "vue";
|
||||||
import * as _ from 'underscore'
|
import * as _ from 'underscore'
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -139,13 +139,13 @@ onMounted(async () => {
|
||||||
|
|
||||||
|
|
||||||
//Generate groups
|
//Generate groups
|
||||||
const wedgesGroup = g.selectAll('.learningSegmentArc').data(pieData).enter().append('g')
|
const learningSequences = g.selectAll('.learningSegmentArc').data(pieData).enter().append('g')
|
||||||
.attr('class', 'learningSegmentArc')
|
.attr('class', 'learningSegmentArc')
|
||||||
.attr('role', 'button')
|
.attr('role', 'button')
|
||||||
.attr('fill', gray300)
|
.attr('fill', gray300)
|
||||||
|
|
||||||
|
|
||||||
wedgesGroup
|
learningSequences
|
||||||
.on('mouseover', function (d, i) {
|
.on('mouseover', function (d, i) {
|
||||||
d3.select(this)
|
d3.select(this)
|
||||||
.transition()
|
.transition()
|
||||||
|
|
@ -163,7 +163,7 @@ onMounted(async () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
wedgesGroup
|
learningSequences
|
||||||
.transition()
|
.transition()
|
||||||
.duration('1000')
|
.duration('1000')
|
||||||
.attr('fill', (d) => {
|
.attr('fill', (d) => {
|
||||||
|
|
@ -171,10 +171,10 @@ onMounted(async () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
wedgesGroup.append('path').attr('d', wedge)
|
learningSequences.append('path').attr('d', wedge)
|
||||||
|
|
||||||
|
|
||||||
const learningSequenceText = wedgesGroup
|
const learningSequenceText = learningSequences
|
||||||
.append('text')
|
.append('text')
|
||||||
.attr('fill', blue900)
|
.attr('fill', blue900)
|
||||||
.style('font-size', 15)
|
.style('font-size', 15)
|
||||||
|
|
@ -191,7 +191,7 @@ onMounted(async () => {
|
||||||
|
|
||||||
const iconWidth = 25
|
const iconWidth = 25
|
||||||
|
|
||||||
const learningSequenceIcon = wedgesGroup.append("svg:image")
|
const learningSequenceIcon = learningSequences.append("svg:image")
|
||||||
.attr("xlink:href", (d) => {
|
.attr("xlink:href", (d) => {
|
||||||
return "/static/icons/" + d.icon.replace("it-", "") + ".svg"
|
return "/static/icons/" + d.icon.replace("it-", "") + ".svg"
|
||||||
})
|
})
|
||||||
|
|
@ -204,22 +204,31 @@ onMounted(async () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Generate groups
|
//Generate groups
|
||||||
const arrows = g
|
const arrows = g
|
||||||
.selectAll('arrow')
|
.selectAll('.arrow')
|
||||||
.data(pieData)
|
.data(pieData)
|
||||||
.enter()
|
.enter()
|
||||||
.append('g')
|
.append('g')
|
||||||
.attr('class', 'arrow')
|
.attr('class', 'arrow')
|
||||||
.attr('marker-end', 'url(#triangle)')
|
.attr('marker-end', 'url(#triangle)')
|
||||||
|
|
||||||
//arrows[3].remove()
|
|
||||||
|
d3.selection.prototype.last = function () {
|
||||||
|
console.log('last', this)
|
||||||
|
let last = this.size() - 1;
|
||||||
|
return d3.select(this.nodes()[last]);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const all_arows = g.selectAll('.arrow')
|
||||||
|
all_arows.last().remove()
|
||||||
|
|
||||||
|
|
||||||
//Draw arrow paths
|
//Draw arrow paths
|
||||||
arrows.append('path').attr('fill', gray500).attr('d', arrow)
|
arrows.append('path').attr('fill', gray500).attr('d', arrow)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue