Migrate d3js to v4 and correct d3js visualisations i.e. bug 3.20. Breadcrumb navigation for the language treemap has been improved
import Ember from 'ember';
export default Ember.Component.extend({
player: Ember.inject.service(),
filter: Ember.inject.service(),
classNames: ['notice-component'],
item: Ember.computed('model', 'player.model', function() {
return this.get('model') || this.get('player').get('model');
}),
participants: Ember.computed('item.contributors', function() {
let participants = [];
const contributors = this.get('item.contributors') || [];
let identifier;
contributors.forEach(function(contributor) {
identifier = contributor.name || contributor.url;
var participant = participants.find(participant => participant.identifier === identifier);
if(participant) {
participant['role'].push(contributor.role.split('/').pop());
} else {
participants.push({ identifier: identifier, role: [ contributor.role.split('/').pop() ] });
}
});
return participants;
}),
location: Ember.computed('item.geoInfo', function() {
var location = '';
if(this.get('item')) {
var meta = this.get('item').get('geoInfo').notes.find(element => element.lang);
if(meta) {
location = meta.value;
}
}
return location;
}),
actions: {
addThemeFilter: function(id) {
this.get('filter').setFilter('theme', id);
},
addLanguageFilter: function(id) {
this.get('filter').setFilter('language', id);
}
}
});