Search in sources :

Example 31 with IndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.

the class DynamicBAWChartEventReceiver method refreshChart.

@Override
public void refreshChart() {
    Map<IndicatorUnit, String> indicators2ValueMap = converIndicatorListToMap();
    SummaryStatisticsState state = new SummaryStatisticsState(indicators, indicators2ValueMap);
    if (!isLastIndicator()) {
        state.setSupportDynamicChart(true);
    }
    state.setSqltype(Types.DOUBLE);
    Object chart = state.getChart();
    TOPChartUtils.getInstance().decorateChart(chart, false);
    if (BAWparentComposite != null) {
        TOPChartUtils.getInstance().refrechChart(BAWparentComposite, chart);
    }
    EventManager.getInstance().publish(chartComposite, EventEnum.DQ_DYNAMIC_REFRESH_DYNAMIC_CHART, null);
}
Also used : ColumnIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) SummaryStatisticsState(org.talend.dataprofiler.core.ui.editor.preview.model.states.SummaryStatisticsState)

Example 32 with IndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.

the class FrequencyDynamicChartEventReceiver method refreshChart.

@Override
public void refreshChart() {
    List<IndicatorUnit> indicatorUnits = new ArrayList<IndicatorUnit>();
    indicatorUnits.add(new ColumnIndicatorUnit(IndicatorEnum.findIndicatorEnum(this.getIndicator().eClass()), this.getIndicator(), null));
    // indicators
    FrequencyStatisticsState state = new FrequencyStatisticsState(indicatorUnits);
    state.setSupportDynamicChart(true);
    Object chart = state.getChart();
    TOPChartUtils.getInstance().decorateChart(chart, false);
    if (this.parentChartComposite != null) {
        TOPChartUtils.getInstance().refrechChart(this.parentChartComposite, chart);
    }
    EventManager.getInstance().publish(chartComposite, EventEnum.DQ_DYNAMIC_REFRESH_DYNAMIC_CHART, null);
}
Also used : ColumnIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ArrayList(java.util.ArrayList) FrequencyStatisticsState(org.talend.dataprofiler.core.ui.editor.preview.model.states.freq.FrequencyStatisticsState) ColumnIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit)

Example 33 with IndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.

the class FrequencyTableState method getDataEntity.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.core.ui.editor.preview.model.states.table.AbstractTableTypeStates#getDataEntity()
     */
@Override
public ChartDataEntity[] getDataEntity() {
    List<ChartDataEntity> dataEnities = new ArrayList<ChartDataEntity>();
    boolean withRowCountIndicator = isWithRowCountIndicator();
    for (IndicatorUnit unit : units) {
        if (unit.isExcuted()) {
            FrequencyExt[] frequencyExt = (FrequencyExt[]) unit.getValue();
            sortIndicator(frequencyExt);
            int numOfShown = FrequencyTypeStateUtil.getNumberOfShown(unit, frequencyExt);
            for (int i = 0; i < numOfShown; i++) {
                FrequencyExt freqExt = frequencyExt[i];
                String keyLabel = FrequencyTypeStateUtil.getKeyLabel(freqExt, 30);
                dataEnities.add(FrequencyTypeStateUtil.createChartEntity(unit.getIndicator(), freqExt, keyLabel, withRowCountIndicator));
            }
        } else {
        // TDQ-11422: before analysis run turn to Analysis Results page, there should show nothing data
        // dataEnities.add(FrequencyTypeStateUtil.createChartEntity(unit.getIndicator(), null, null, false));
        }
    }
    return dataEnities.toArray(new ChartDataEntity[dataEnities.size()]);
}
Also used : ArrayList(java.util.ArrayList) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) FrequencyExt(org.talend.dq.indicators.ext.FrequencyExt)

Example 34 with IndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.

the class ModeStatisticsTableState method getDataEntity.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.core.ui.editor.preview.model.states.table.AbstractTableTypeStates#getDataEntity()
     */
@Override
public ChartDataEntity[] getDataEntity() {
    List<ChartDataEntity> dataEnities = new ArrayList<ChartDataEntity>();
    for (IndicatorUnit unit : units) {
        ChartDataEntity entity = ModeStatisticsStateUtil.createDataEntity(unit, unit.getIndicatorName());
        dataEnities.add(entity);
    }
    return dataEnities.toArray(new ChartDataEntity[dataEnities.size()]);
}
Also used : ArrayList(java.util.ArrayList) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity)

Example 35 with IndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.

the class CommonStateUtil method getDataEntity.

public static ChartDataEntity[] getDataEntity(List<IndicatorUnit> units, int style) {
    List<ChartDataEntity> dataEnities = new ArrayList<ChartDataEntity>();
    for (IndicatorUnit unit : units) {
        String value = getUnitValue(unit.getValue(), style);
        ChartDataEntity entity = createDataEntity(unit, value, unit.getIndicatorName());
        dataEnities.add(entity);
    }
    return dataEnities.toArray(new ChartDataEntity[dataEnities.size()]);
}
Also used : ArrayList(java.util.ArrayList) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity)

Aggregations

IndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit)54 ArrayList (java.util.ArrayList)24 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)17 ChartDataEntity (org.talend.dq.indicators.preview.table.ChartDataEntity)17 ColumnIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit)13 CustomerDefaultCategoryDataset (org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)10 TreeItem (org.eclipse.swt.widgets.TreeItem)9 Indicator (org.talend.dataquality.indicators.Indicator)9 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)7 FrequencyExt (org.talend.dq.indicators.ext.FrequencyExt)7 BoxIndicator (org.talend.dataquality.indicators.BoxIndicator)5 CountsIndicator (org.talend.dataquality.indicators.CountsIndicator)5 IQRIndicator (org.talend.dataquality.indicators.IQRIndicator)5 PhoneNumbStatisticsIndicator (org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator)5 IRepositoryNode (org.talend.repository.model.IRepositoryNode)5 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)4 ColumnSetIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit)4 IndicatorEnum (org.talend.dq.nodes.indicator.type.IndicatorEnum)4 IChartTypeStates (org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates)3 AverageLengthIndicator (org.talend.dataquality.indicators.AverageLengthIndicator)3