M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 43
Registered: ‎04-21-2017
Accepted Solution

Change Vector Set added through Analyzer API

Hi guys

 

is there a way to change one or more vector sets that have been added to the Analyzer View through the API?

 

Thanks a lot

 

AA

AA
Technical Evangelist
Posts: 29
Registered: ‎04-04-2018

Re: Change Vector Set added through Analyzer API

Hello,

 

Yes, absolutely!

 

Update Example:

 

Analyzer.updateDataset( {
  stageId: "custom stage",
  dataset: { 
    mode : EnterpriseConnector,
    vectorset: "vs name",
    datasetName: "dataset name"
  }
});              

To remove: 

Analyzer.removeStage( Analyzer.findStageModel("dataset to be removed"));

HTH,

 

Dave

  

Contributor
Posts: 43
Registered: ‎04-21-2017

Re: Change Vector Set added through Analyzer API

Hi Dave

 

Thanks for your help

 

I followed your example and it seemed to work

Following the update, I checked 

stage = Analyzer.findStageModel("my stage");

and I found the new vector set and the new data set

 

then I applied and saved 

 

But when I reloaded the Analyzer View and checked again, I found the old vector set and data set

 

Any suggestions?

 

Thanks a lot

 

 

AA
Technical Evangelist
Posts: 29
Registered: ‎04-04-2018

Re: Change Vector Set added through Analyzer API

[ Edited ]

Just checked - the current release version doesn't update the view configuration. This will happen automatically in the next release. You can still update the configuration manually:

 

let dataset = {
  mode : EnterpriseConnector,
  vectorset: "vs name",
  datasetName: "dataset name"
}

Call Analyzer.updateDataset, and then:

 
// update persisted configuration
let stageModelList = M.app.state.applicationConfiguration.chartConfiguration.customStageModelConfiguration;

let found = stageModelList.find((stage) => {
  return stage.stageId === "Name of dataset to Update";
});

if (found) {
  found.dataset = dataset;
}
Contributor
Posts: 43
Registered: ‎04-21-2017

Re: Change Vector Set added through Analyzer API

Thank you so much, David

It works

 

Best

Anto

AA