%mandatory -->  dataSource;
%optional  -->  figureName , dimentions , groupsCol;

function plotDVPParallelCoordinates( dataSource , figureName , dimentions , groupsCol) 
if nargin < 1
    error('not enough parameters');
end

 if ~ischar(dataSource)
        
       if ~isnumeric(dataSource)
          error('invalid dataSoure!'); 
       end
       
     ctr = getappdata(0,'counter');
     dsName = strcat('datasource',int2str(ctr+1));
     setappdata(0,'counter',ctr+1);
     createDVPDataSource(dataSource,dsName); 
     
 else
        dsName = dataSource;
 end
    

if ~exist('figureName','var')
    ctr = getappdata(0,'counter');
    figName = strcat('Parallel',int2str(++ctr));
    
    else
        figName = figureName;
end

if ~exist('features','var') || isempty(dimentions)
    featuresList = 'All-Features';
    
else
    
    if ~isnumeric(dimentions)
        error('Invalid dimentions');
    end
        featuresList = dimentions;
end

if ~exist('groupsCol','var') || isempty(groupsCol)|| isnumeric(groupsCol)
    groups = 'invalid-groups-col';
    
else
        groups = groupsCol;
end

data = struct('requestType', 'create', 'operation', 'figure',...
    'config', struct('figureType', 'ParallelCoordinates', 'id',figName,...
    'dataSourceID', dsName,...
    'figureProperties', struct('features',featuresList  , 'groups' , groups)));

sendDataToDVP(data);

end