Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"click #btnResetFilter": function() {
// Reset all currently applied filters for all the charts
list = dc.chartRegistry.list('attackers')
for (e in list) {
chart = list[e];
chart.filterAll()
}
},
"mouseenter #attackerLimit": function(e,t){
.xUnits(dc.units.fp.precision(binwidth))
.margins({ top: 5, right: 20, bottom: 25, left: 45 })
.ordinalColors(['#2fa4e7'])
.brushOn(true)
.x(xScaleForBar)
.renderHorizontalGridLines(true)
.xAxis()
.ticks(10);
dc.renderAll(); // Render all charts
// Get chart data from dc registry
const chartData = timeStampDimension.top(Infinity);
// Iterate throuh each chart in a registry & set listeners for filtering
_.forEach(dc.chartRegistry.list(), (chart) => {
chart.on('filtered', () => {
const filteredChartData = timeStampDimension.top(Infinity);
instance.updateDataTable(filteredChartData);
instance.updateLineChart(requestsOverTime, overviewChart, timeScaleForLineChart);
instance.updateStatisticsData(filteredChartData);
});
});
instance.updateDataTable(chartData);
instance.updateStatisticsData(chartData);
};
function _getFilters() {
//build a list of what charts are selecting what.
//expects chart.mongoField to specify
//what field use for the filters.
result = {};
list = dc.chartRegistry.list( 'alertssummary' );
for ( e in list ) {
chart = list[e];
//console.log('getting filters for',chart,chart.dimension())
//check for .mongoField attribute of chart
//to include in filter selection
if ( _.has( chart.dimension(), 'mongoField' ) ) {
//console.log(chart.dimension().mongoField,chart.filters());
//describe this chart's selections by field/values
if ( chart.dimension().mongoField ) {
result[chart.chartID()] = { 'field': chart.dimension().mongoField, 'filters': chart.filters() }
}
}
}
//console.log('getfilters result is', result);
return result;
}
refreshAlertsData = function() {
//walk the chartRegistry
list = dc.chartRegistry.list( 'alertssummary' )
for ( e in list ) {
chart = list[e];
//apply current filters
chart.dimension().filter();
}
//get new time frame
refreshVolumeChartXAxis();
//re-render
dc.renderAll( "alertssummary" );
}
filterCharacters = function(chart,filter){
clearCharacters();
//walk the chartRegistry
list = dc.chartRegistry.list('attackers')
for (e in list){
chart = list[e];
//apply current filters
chart.dimension().filter();
}
//re-render
dc.renderAll("attackers");
//set tooltips on the chart titles
//to display the current filters.
$('#LastSeen').prop('title', "");
lastSeenFilters=ringChartLastSeen.filters();
if (lastSeenFilters.length>0) {
$('#LastSeen').prop('title', lastSeenFilters);
}
$('#Categories').prop('title', "");
categoryFilters=ringChartAttackerCategory.filters();