IVZDataNormalizeAdapter.NormalizeMode

Fore Syntax

NormalizeMode: VisualizatorDataAdapterMode;

Fore.NET Syntax

NormalizeMode: Prognoz.Platform.Interop.Visualizators.VisualizatorDataAdapterMode;

Description

The NormalizeMode property determines data normalization mode.

Fore Example

Executing the example requires that the repository contains an express report with the EXP identifier. The Size metric should be selected in the bubble tree report. The module containing the example should have links to the Express, Metabase and Visualizators system assemblies. The selected procedure should be called from the Main entry point.

Execute logarithmic transformation of numbers -0.05, 0, 0.05, 5 and 1000:

Sub UserProc;
Var
    Metabase: IMetabase; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    DataSourceMapping: IVZDataSourceMapping; // Settings used for data mapping
    SizeVisual: IVZNumericVisual; // Visualizator of bubble tree bubble size  
    DataSource: IVZMultiplyDataSource; // Data source
    DataTransformer: IVZDataNormalizeAdapter; // Data transformer 
Begin
    // Get metabase object
    Metabase := MetabaseClass.Active;
    // Get express report object
    EaxAnalyzer := Metabase.ItemById("EXP").Edit As IEaxAnalyzer;
    // Get text visualizer
    SizeVisual := EaxAnalyzer.BubbleTree.BubbleTree.SizeVisual;
    // Get settings for data mapping
    DataSourceMapping := SizeVisual.NumericMapping;
    // Set mapping type "Data transformer"
    DataSourceMapping.MappingType := VisualizatorDataMappingType.DataMappingTransformer;
    // Set title for data source corresponding to identifier
    DataSource := DataSourceMapping.DataSource; 
    // Create data transformer
    DataTransformer := New VZDataNormalizeAdapter.Create;
    // Load data from source
    DataTransformer.InitializeFromDataSource(DataSource);   
    // Set logarithmic data normalization mode
    DataTransformer.NormalizeMode := VisualizatorDataAdapterMode.Logarithm;
    // Set this transformer
    DataSourceMapping.DataTransformer := DataTransformer As IVZDataAdapter;
    Debug.WriteLine("Data transformation:");
    Debug.IndentLevel := 1;
    Debug.WriteLine("Input: -0.05, output: " + 
        ((DataTransformer.GetData(-0.05)) As Double).ToString);
    Debug.WriteLine("Input: 0, output: " + 
        ((DataTransformer.GetData(0)) As Double).ToString);     
    Debug.WriteLine("Input: 0.05, output: " + 
            ((DataTransformer.GetData(0.05)) As Double).ToString);      
    Debug.WriteLine("Input: 5, output: " + 
            ((DataTransformer.GetData(5)) As Double).ToString);                         
    Debug.WriteLine("Input: 1000, output: " + 
            ((DataTransformer.GetData(1000)) As Double).ToString);
End Sub UserProc;

After executing the example, the numbers -0.05, 0, 0.05, 5 and 1000 are logarithmically transformed. Results of this transformation are shown on the development environment console window:

Data transformation:

    Input: -0.05, output: -1.#IND

    Input: 0, output: 0.2

    Input: 0.05, output: 0.2

    Input: 5, output: 1.6094379124341

    Input: 1000, output: 6.90775527898214

Fore.NET Example

Executing the example requires that the repository contains an express report with the EXP identifier. The selected procedure is the Main entry point in the Program module of the .NET assembly. The Express, Metabase and Visualizators assemblies should be imported to this module from the Prognoz.Platform.Interop system assembly.

Execute logarithmic transformation of numbers -0.05, 0, 0.05, 5 and 1000:

Public Shared Sub Main(Params: StartParams);
Var
    Metabase: IMetabase; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    BubbleTree: IVZBubbleTree; // Bubble tree
    DataSourceMapping: IVZDataSourceMapping; // Settings for data mapping
    SizeVisual: IVZNumericVisual; // Visualizator of bubble tree bubble size  
    DataSource: IVZMultiplyDataSource; // Data source
    DataTransformer: IVZDataNormalizeAdapter; // Data transformer 
Begin
    // Get metabase object
    Metabase := Params.Metabase;
    // Get express report object
    EaxAnalyzer := Metabase.ItemById["EXP"].Edit() As IEaxAnalyzer;
    // Get text visualizer
    SizeVisual := EaxAnalyzer.BubbleTree.BubbleTree.SizeVisual;
    // Get settings for data mapping
    DataSourceMapping := SizeVisual.NumericMapping;
    // Set mapping type "Data transformer"
    DataSourceMapping.MappingType := VisualizatorDataMappingType.vdmtDataMappingTransformer;
    // Set title for data source corresponding to identifier
    DataSource := DataSourceMapping.DataSource; 
    // Create data transformer
    DataTransformer := New VZDataNormalizeAdapter();
    // Load data from source
    DataTransformer.InitializeFromDataSource(DataSource As VZMultiplyDataSource);   
    // Set logarithmic mode of data normalization
    DataTransformer.NormalizeMode := VisualizatorDataAdapterMode.vdamLogarithm;
    System.Diagnostics.Debug.WriteLine("Data transformation:");
    System.Diagnostics.Debug.IndentLevel := 1;
    System.Diagnostics.Debug.WriteLine("Input: -0.05, output: " + 
        ((DataTransformer.GetData(-0.05)) As Double).ToString());
    System.Diagnostics.Debug.WriteLine("Input: 0, output: " + 
        ((DataTransformer.GetData(0)) As Double).ToString());       
    System.Diagnostics.Debug.WriteLine("Input: 0.05, output: " + 
            ((DataTransformer.GetData(0.05)) As Double).ToString());        
    System.Diagnostics.Debug.WriteLine("Input: 5, output: " + 
            ((DataTransformer.GetData(5)) As Double).ToString());                           
    System.Diagnostics.Debug.WriteLine("Input: 1000, output: " + 
            ((DataTransformer.GetData(1000)) As Double).ToString());
End Sub;

The result of the executed example is the same as that, executed for Fore language.

See also:

IVZDataNormalizeAdapter