Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from macartur/add_color_in_links
Browse files Browse the repository at this point in the history
Add metodos to change links colors
  • Loading branch information
beraldoleal authored Apr 10, 2018
2 parents b76e523 + 7431d14 commit e902611
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/components/kytos/topology/Topology.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,25 @@ export default {
},
methods: {
setListeners () {
this.$kytos.$on('changeLinksColor', this.change_links_color)
this.$kytos.$on('clearLinksColor', this.clear_links_color)
this.$kytos.$on("topology-highlightAll", (p) => {
if (!this.check_switch_under_click(p)) this.highlight_all_elements()
})
this.$kytos.$on("topology-toggle-label", this.toggle_labels)
},
clear_links_color(){
$.each(this.graph.links, function(index, link){
d3.select('#link-'+link.id).attr("stroke", 'gray')
})
},
change_links_color(color, links){
var self = this
$.each(links, function(index, link){
var link_id = self.fix_name(link.a) + '___' + self.fix_name(link.b)
d3.select('#link-'+link_id).attr("stroke", color)
})
},
check_switch_under_click (p) {
// p: point that was clicked with p.x and p.y attributes
let s, dx2, dy2, dist
Expand Down Expand Up @@ -556,9 +570,6 @@ export default {
.hide
display: none;
line
stroke: rgba(255, 255, 255, 0.5);
.node
cursor: pointer;
Expand Down

0 comments on commit e902611

Please sign in to comment.