Think of provisioning information on real-life objects or straw through Cloud data like persons, related contacts, documents and other stuff. This allows you to build rich applications containing information you normally process in a 2D world like your browsers. By extending it to a 3D world, you are able to process the data in a completely different way. Think of creating teams of people within your organization and group them based on specialties, getting a more clear inside view of your site structure in SharePoint or have a 3D model of the Microsoft Graph entities related objects
Code motion - Extend visualization of microsoft graph data to hololens applications
1. Extend visualization of Microsoft Graph data to
HoloLens applications
Alexander Meijers | 16.10 | room 5
AMSTERDAM | MAY 8-9, 2018
2. ABOUT ME
• HoloLens Evangelist / Solutions Architect @ ETTU
• Mixed Reality Team
• Microsoft Windows Development MVP for Mixed Reality
• Founder of the Mixed Reality User Group and one of
the organizers of Global AI Bootcamp
Email: a.meijers@ettu.nl / alexander@appzinside.com
Twitter: @ameijers
Blog: http://www.appzinside.com
Slides are under Creative Common License
3. AGENDA
• What are we going to build?
• Mixed Reality & HoloLens
• Microsoft Graph
• Mathematical visualization
• Connecting the dots
5. WHAT ARE WE GOING TO BUILD?
• Building a HoloLens application
• Getting people and related people data from Office 365
• Visualize the people and their relations in 3D
• Watch the model and interact!
7. REALITIES EXPLAINED
Merging of real and
virtual worlds to produce
new environments and
visualizations where
physical and digital
objects co-exist and
interact in real time.
An overlay of synthetic
content on the real world
that is anchored to and
interacts with the real
world
MIXED REALITY
Direct or indirect view of a
physical, real-world
environment whose
elements
are augmented by
computer-generated
sensory input such as
sound, video, graphics
or GPS data
An overlay of content on
the real world where that
content is not anchored to
or part of it
AUGMENTED REALITY
Generation of realistic
images, sounds and other
sensations that replicate a
real environment or create
an imaginary setting
An immersive experience
created entirely from
computer-generated
Content. Also similar to
360 degree video
VIRTUAL REALITY
8. MICROSOFT HOLOLENS
SPECIFICATIONS
• Windows 10 device based
on 32 bit architecture
• 64GB flash
• 2GB memory
• 1GB Holographic Processor Unity (HPU)
• First of its kind
• Device is more powerful than a laptop
• No overheating due to warm air flows to the sides
• 2-3 hours active and 2 weeks standby
• Weight 579g
15. MICROSOFT GRAPH API
• Connect to Office 365
• Graph Explorer
• Allows you to use the API on
your tenant
• Administrator consent is
neccessary
App
registration
Authenticate Do API calls
Handle
returned
data
• Lots of documentation
• API delivers v1 and beta
interfaces
• https://developer.microsoft.c
om/en-us/graph
16. APP REGISTRATION
• Registration of an app is done in the following portal
• https://apps.dev.microsoft.com
• In the future through the Azure Portal
• For registration a personal or organizational account can be used
• When organizational account is used, apps are registrated and
managable from their tenant
• Use an organizational account when building an app for your
organization
• Select one or more platforms
17. SCOPES & CONSENT
• Define which scopes
• You don’t need to define them when
you registrate your app
• You specify when you authenticate
from your app
• All applications are currently multi-tenant
• Targeting specific audiences will be
available later
• Currently using specific URLs
18. AZURE AD AND MSAL
• Azure Active Directory (Azure AD) v2.0 endpoint
• Support OAuth 2.0 and OpenID Connect 1.0
• Converged authentication
• Azure AD v2.0 works with client libraries
• Allows native client applications to get access tokens for calling resources
like Microsoft Graph, Outlook Mail, Calendar, Contacts
• Microsoft Authentication Library (MSAL)
• MSAL supports this endpoint
• Allows to use organizational Office 365 (Azure AD) accounts or Personal
Microsoft accounts
• Not a replacement for ADAL
• MSAL.NET (in preview)
• Platforms: .NET (Framework) Client, Windows Store, Xamarin iOS and Android
• Microsoft.Identity.Client nuget package
19. GUIDED SETUP
• Helps you to registrate the app
• Generates code for you to
authenticate against for
example the Microsoft Graph
• Authentication uses Microsoft
Authentication Library (MSAL)
• References the
Microsoft.Identity.Client nuget
package
21. HTTPS CALLS versus MICROSOFT.GRAPH
• Microsoft Graph Client Library allows you to call Office 365, Azure AD and other
Microsoft services through a single unified developer experience
• https://github.com/microsoftgraph/msgraph-sdk-dotnet
Getting related
people for me
Getting related
people for a specific
user
Returns
HTTP Calls https://graph.microsoft.com
/v1.0/me/People
https://graph.microsoft.com
/v1.0/Users/{GUID of user
id}/People
Json payload
Microsoft.Graph interface List<Person> persons =
new List<Person>();
var people = await
graphClient.Me.People.Re
quest().GetAsync();
persons.AddRange(people
);
List<Person> persons =
new List<Person>();
var people = await
graphClient.Users[id].Peopl
e.Request().GetAsync();
persons.AddRange(people
);
Returns C# objects
24. FORCE DETECT GRAPH
• A number of algorithms which allows you to draw data and their underlaying
relationships in a two- or three-dimensional way
25. FORCE DETECT GRAPH
• Data is positioned by nodes and
relations are positioned by edges
• Algorithm assign forces between
nodes and between edges
• Edges are mostly the same length and
do have the least number of crossings
• Adding new nodes and edges will reposition the model
• Woong Gyu La – Developer from Canada
• Wrote a 2D/3D Force Directed Graph Algorithm in C#
• https://github.com/juhgiyo/EpForceDirectedGraph.cs
28. CHALLENGES
• Setup a project in Unity for building a HoloLens application
• Arrange prefabs for nodes and edges
• Assets like materials, shaders and more
• Use a separate DLL to access Microsoft Graph
• Asynchronously calls
• More separation of data retrieval and data handling
• Incorporate DLL into Unity
• Incorporate depending DLLs
• Integrate Force Detect Graph code in Unity
• Add code to access DLL and
use FDG to handle data
29. CHALLENGES
• Add code to access DLL
• Authentication against Microsoft Graph using MSAL
• Execute of API calls to get data
• Use of #if !UNITY_EDITOR to prevent compiler issues in Unity
• Add code to generate GameObjects based on returned data
• Use of Force Detect Graph code to create model
• Use of a queue to get around the issue
that Unity objects cannot be created in
a separate non-Unity thread
• Adding Mixed Reality parts
• Gaze cursor for selection
• Gestures for handling interaction
• Interaction for selecting
person and relations