Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
//if it's not already in there:
if (this.tableManager.colOrder.filter((a: any) => { return a === arrayVector.desc.name; }).length < 1) {
this.tableManager.colOrder = [arrayVector.desc.name].concat(this.tableManager.colOrder); // store array of names
}
});
//clear out any attributes that aren't in the top 5
// Add highly connected nodes to the adj Matrix:
const allNodes = this.graph.nodes.slice(0).sort((a, b) => { return a.degree > b.degree ? -1 : 1; });
const connectedNodes = allNodes.slice(0, 5);
console.profileEnd();
events.fire(TABLE_VIS_ROWS_CHANGED_EVENT);
});
// remove timepoints that are already selected
timepoints = timepoints.filter((d) => selectedTimePoints.indexOf(d) === -1);
if (timepoints.length > 2) {
timepoints = timepoints.slice(0, 2);
}
selectedTimePoints.push(...timepoints);
// sort elements by time -> [0] = earlier = source; [1] = later = destination
selectedTimePoints = selectedTimePoints.sort((a, b) => d3.ascending(a.time.toISOString(), b.time.toISOString()));
hash.setProp(AppConstants.HASH_PROPS.TIME_POINTS, selectedTimePoints.map((d) => d.key).join(','));
hash.removeProp(AppConstants.HASH_PROPS.DETAIL_VIEW);
events.fire(AppConstants.EVENT_TIME_POINTS_SELECTED, selectedTimePoints);
// clear after 2 selected time points
if (selectedTimePoints.length === 2) {
selectedTimePoints = [];
}
}
'icon': 'Add2Matrix', 'string': removeAdjMatrix ? 'Remove from Table' : 'Add to Table', 'callback': () => {
events.fire(ADJ_MATRIX_CHANGED, { 'db': this.selectedDB, 'name': d.title, 'uuid': d.uuid, 'remove': removeAdjMatrix, 'nodes': this.graph.nodes.map((n) => n.uuid) });
},
.on('mouseleave', (d) => {
events.fire(AppConstants.EVENT_TIME_POINT_HOVERED, d[1].time.toDate(), false);
})
.on('click', (d) => {
.on('click', function (selectedType) {
const button = d3.select(this);
if (button.classed('active')) {
selectedType.isActive = false;
events.fire(AppConstants.EVENT_HIDE_CHANGE, selectedType);
ChangeTypes.updateFilterHash();
button
.classed('active', false)
.classed('inactive', true);
} else {
selectedType.isActive = true;
events.fire(AppConstants.EVENT_SHOW_CHANGE, selectedType);
ChangeTypes.updateFilterHash();
button
.classed('active', true)
.classed('inactive', false);
}
});
}
selectAll('.dropdown-item-map').on('mousedown', function (d) {
event.preventDefault();
//Check if is selected, if so remove from table.
d = d.toString()
if (self.currentSelectedMapAttribute!=d) {
self.currentSelectedMapAttribute = d as string;
selectAll('.dropdown-item-map').classed('active',false);
select(this).classed('active', true);
events.fire(MAP_ATTRIBUTE_CHANGE_EVENT,undefined)
}
});
static remove(ds: MalevoDataset) {
DataStoreSelectedRun.setSelectionIndex(dataStoreRuns.get(ds.name).selectionIndex, null);
dataStoreRuns.delete(ds.name);
if (dataStoreRuns.size === 0) {
DataStoreCellSelection.deselect();
}
events.fire(AppConstants.EVENT_DATA_SET_REMOVED, ds);
events.fire(AppConstants.EVENT_REDRAW);
}
'icon': 'MakeRoot', 'string': 'Make Root', 'callback': () => {
events.fire(ROOT_CHANGED_EVENT, { 'root': d });
}
},
'mouseover'(d) {
event.fire('sampleHighlight', d.w.sample, true);
event.fire('highlightJxn', d3.select(this.parentNode).data()[0].key, true);
},
'mouseout'(d) {
static toggleYScaling() {
this._yScalingIsLinear = !this._yScalingIsLinear;
events.fire(AppConstants.EVENT_WEIGHT_FACTOR_CHANGED, this.weightFactor);
}