havidarou
(Javier Castro)
November 2, 2017, 6:00pm
1
Hi,
I am trying to provide an AppState to an embedded visualization:
visualizeLoader.embedVisualizationWithId(visContainer, $scope.selectedVisualization, {
timeRange: timeRange, appState: AppState
}).then(handler => {
console.log('render complete');
});
Being AppState included as a dependency in the controller:
> app.controller('WebinarDemo', function ($scope, Private, savedVisualizations, AppState) {
When I try to load it:
Am I doing something wrong? how do I go about this?
Regards.
havidarou
(Javier Castro)
November 2, 2017, 7:45pm
2
I changed the AppState initialization like this (adding the getAppState service in my controller):
let currentAppState = getAppState();
if (!currentAppState) {
$scope.state = new AppState(getStateDefaults());
}
function getStateDefaults() {
return {
query: '',
index: 'c78aa9f0-bfec-11e7-bd67-eb6db07d9b4b',
interval: 'auto',
filters: {}
};
}
I'm using some hardcoded defaults for the appState initialization.
Then I use it as param in my embed visualization:
$scope.$watch('selectedVisualization', () => {
if (!$scope.selectedVisualization) return;
visualizeLoader.embedVisualizationWithId(visContainer, $scope.selectedVisualization, {
timeRange: timeRange, appState: $scope.state
}).then(handler => {
console.log('render complete');
});
});
But it's not affecting at all the visualization.
Regards.
weltenwort
(Felix Stürmer)
November 3, 2017, 11:24am
3
It's nice to see that you are trying to build on the examples of one of the webinars. I will try to get the visualization team in here, because they can probably help you much more competently.
system
(system)
Closed
December 1, 2017, 11:25am
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.