How to use the dc.chartRegistry function in dc

To help you get started, we’ve selected a few dc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / MozDef / meteor / client / attackers.js View on Github external
"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){
github apinf / platform / apinf_packages / dashboard / client / charts / charts.js View on Github external
.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);
  };
github mozilla / MozDef / meteor / client / alertsummary.js View on Github external
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;
        }
github mozilla / MozDef / meteor / client / alertsummary.js View on Github external
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" );

        }
github mozilla / MozDef / meteor / client / attackers.js View on Github external
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();

dc

A multi-dimensional charting library built to work natively with crossfilter and rendered using d3.js

Apache-2.0
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis