SlideShare a Scribd company logo
Public
Building Custom Controls to Visualize Data
Maximilian Lenkeit
@mlenkeit
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 2Public@mlenkeit
Disclaimer
This presentation outlines our general product direction and should not be relied on in making a
purchase decision. This presentation is not subject to your license agreement or any other agreement
with SAP. SAP has no obligation to pursue any course of business outlined in this presentation or to
develop or release any functionality mentioned in this presentation. This presentation and SAP's
strategy and possible future developments are subject to change and may be changed by SAP at any
time for any reason without notice. This document is provided without a warranty of any kind, either
express or implied, including but not limited to, the implied warranties of merchantability, fitness for a
particular purpose, or non-infringement. SAP assumes no responsibility for errors or omissions in this
document, except if such damages were caused by SAP intentionally or grossly negligent.
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 3Public@mlenkeit
Agenda
Introduction
Example: Connected Shipping Containers
Visualizations in SAPUI5
Key Takeaways
Public
Connected Shipping
Containers
An Example for Custom Visualizations in SAP Fiori-like Apps
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 5Public@mlenkeit
Scenario Description
Port operator
Containers equipped with sensors
 Protect against theft
 Track damage
 Maintain cold chain
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 6Public@mlenkeit
Technical Setup
© 2015 SAP SE or an SAP affiliate company. All rights reserved. 7Public
Public
Visualizations in SAPUI5
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 9Public@mlenkeit
Scalable Vector Graphics
Similar to HTML
 XML-based
 CSS for styling
Common shapes
 Path
 Circle
 Rectangle
 Group
 …
<svg>
<rect width="20" height="90" x="0" transform="translate(0, 0)"></rect>
<rect width="20" height="85" x="25" transform="translate(0, 5)"></rect>
<rect width="20" height="80" x="50" transform="translate(0, 10)"></rect>
</svg>
rect {
fill: rgb(240,171,0);
}
+
=
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 10Public@mlenkeit
Open Source Library D3.js
References
 VizFrame
 Hundreds of examples online
Key Features
 Low-level APIs
 Data binding
var selSvg = d3.select("#svg");
var aData = [ {x:30}, {x:25}, {x:20} ];
var selRects = selSvg.selectAll("rect").data(aData);
selRects.enter().append("rect")
.attr("width", 20)
.attr("height", function(d) { return d.x; })
.attr("x", function(d, i) { return i * 25; });
<svg id="svg">
<rect width="20" height="30" x="0"></rect>
<rect width="20" height="25" x="25"></rect>
<rect width="20" height="20" x="50"></rect>
</svg>
=
=
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 11Public@mlenkeit
Recommendations for Creating Visualizations in SAPUI5
Do’s
 Wrap visualization into custom control
 Integrate with SAPUI5 data binding
 Use theme parameters
 Make it responsive
Don’ts
 Re-render from scratch
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 12Public@mlenkeit
Wrapping Visualization Into Custom Control
Benefits
 Use in XML views
 Leverage data binding
 Reuse DOM
Checklist
 Use sap.ui.core.HTML to render a container
 Render in container from onAfterRendering
<Page title="Dashboard">
<custom:CustomChart ... />
</Page>
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 13Public@mlenkeit
Code Sample for Custom Control Skeleton
Control.extend("CustomChart", {
metadata : {
aggregations : {
_html : { type : "sap.ui.core.HTML", multiple : false, visibility : "hidden" }
}
},
init : function() {
this._sContainerId = this.getId() + "--container";
this.setAggregation("_html", new sap.ui.core.HTML({ content : "<svg id='" + this._sContainerId + "'></svg>" }));
},
renderer : function(oRm, oControl) {
oRm.write("<div");
oRm.writeControlData(oControl);
oRm.write(">");
oRm.renderControl(oControl.getAggregation("_html"));
oRm.write("</div>");
},
onAfterRendering : function() {
var aData = [ {x:30}, {x:25}, {x:20} ];
var selRects = d3.select("#" + this._sContainerId).selectAll("rect").data(aData);
selRects.enter().append("rect").attr("width", 20)/*...*/;
}
});
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 14Public@mlenkeit
Integrating with SAPUI5 Data Binding
What we’d like to do
Benefits
 Use with different data
 Abstract data source
 Standard sorting and filtering
var oModel = new JSONModel({ data : [ {x:30}, {x:25}, {x:20} ] });
var oControl = new CustomChart({
data : { path: '/data' }
});
oControl.setModel(oModel);
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 15Public@mlenkeit
Code Sample for Integrating D3.js Data Binding with SAPUI5
Control.extend("CustomChart", {
metadata : {
aggregations : {
data : { type : "sap.ui.base.ManagedObject" }
}
},
// ...
onAfterRendering : function() {
var aData = this.getBinding("data").getContexts().map(function(oContext) {
return oContext.getObject();
});
// d3.js rendering logic
}
});
var oModel = new JSONModel({ data : [ {x:30}, {x:25}, {x:20} ] });
var oControl = new CustomChart({
data : { path: '/data' }
});
oControl.setModel(oModel);
var oModel = new JSONModel({ data : [ {x:30}, {x:25}, {x:20} ] });
var oControl = new CustomChart({
data : { path: '/data', template : new sap.ui.base.ManagedObject() }
});
oControl.setModel(oModel);
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 16Public@mlenkeit
Using Theme Parameters
Benefits
 Consistent with theme
 Leverage color dependencies
Example
Hint
sap.ui.core.theming.Parameters.get() returns all parameters
onAfterRendering : function() {
var aData = [ {x:30}, {x:25}, {x:20} ];
var selRects = d3.select("#" + this._sContainerId).selectAll("rect").data(aData);
selRects.enter().append("rect").attr("width", 20)/*...*/
.attr("fill", function(d, i) { return sap.ui.core.theming.Parameters.get("sapUiChart" + i); });
}
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 17Public@mlenkeit
Make It Responsive
Benefits
 Enable control for different screen sizes
 Improve user experience per device
Example
onAfterRendering : function() {
this._sResizeHandlerId = sap.ui.core.ResizeHandler.register(this, jQuery.proxy(this._onResize, this));
},
onBeforeRendering : function() {
sap.ui.core.ResizeHandler.deregister(this._sResizeHandlerId);
},
exit : function() {
sap.ui.core.ResizeHandler.deregister(this._sResizeHandlerId);
},
_onResize : function(oEvent) {
// oEvent.size.width
// oEvent.size.height
}
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 18Public@mlenkeit
Re-rendering from Scratch
Problem
DOM operations expensive
HTML control retains DOM
No re-render required
Recommended pattern
onAfterRendering : function() {
if (this.bSetupDone !== true) {
// create static parts like axis, backgrounds, etc.
this.bSetupDone = true;
}
// update the moving parts
}
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 19Public@mlenkeit
Recommendations for Creating Visualizations in SAPUI5
Do’s
 Wrap visualization into custom control
 Integrate with SAPUI5 data binding
 Use theme parameters
 Make it responsive
Don’ts
 Re-render from scratch
Public
Connected Shipping
Containers
Let’s Look Behind the Scenes
Public
Key Takeaways
© 2016 SAP SE or an SAP affiliate company. All rights reserved. 22Public@mlenkeit
Key Takeaways
Custom visualizations
 Easy to build and integrate with SAPUI5
 Help to tailor an app to the user’s needs
Try it yourself
 Take the scaffold
 Get creative!
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Thank you
Contact information:
Maximilian Lenkeit
Senior Developer, SAP Custom Development
Twitter: @mlenkeit
Ad

More Related Content

What's hot (18)

Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
Sakthi Bro
 
Android Materials Design
Android Materials Design Android Materials Design
Android Materials Design
Mohammad Aljobairi
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
Betclic Everest Group Tech Team
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework
Camilo Lopes
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
Dan Wahlin
 
JavaScript Patterns and Principles
JavaScript Patterns and PrinciplesJavaScript Patterns and Principles
JavaScript Patterns and Principles
Aaronius
 
Intro to AngularJS
Intro to AngularJSIntro to AngularJS
Intro to AngularJS
Aaronius
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0
Nagaraju Sangam
 
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
Nicolás Bouhid
 
Discover AngularJS
Discover AngularJSDiscover AngularJS
Discover AngularJS
Fabien Vauchelles
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS
OrisysIndia
 
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Joke Puts
 
Dicoding Developer Coaching #21: Android | Cara Membuat Widget di Aplikasi An...
Dicoding Developer Coaching #21: Android | Cara Membuat Widget di Aplikasi An...Dicoding Developer Coaching #21: Android | Cara Membuat Widget di Aplikasi An...
Dicoding Developer Coaching #21: Android | Cara Membuat Widget di Aplikasi An...
DicodingEvent
 
Different way to share data between controllers in angular js
Different way to share data between controllers in angular jsDifferent way to share data between controllers in angular js
Different way to share data between controllers in angular js
codeandyou forums
 
Fast Prototyping Strategies for UI design
Fast Prototyping Strategies for UI designFast Prototyping Strategies for UI design
Fast Prototyping Strategies for UI design
Luis Daniel Rodriguez
 
Manipulating Magento - Meet Magento Belgium 2017
Manipulating Magento - Meet Magento Belgium 2017Manipulating Magento - Meet Magento Belgium 2017
Manipulating Magento - Meet Magento Belgium 2017
Joke Puts
 
Angular Seminar-js
Angular Seminar-jsAngular Seminar-js
Angular Seminar-js
Mindfire Solutions
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
Barcamp Saigon
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
Sakthi Bro
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework
Camilo Lopes
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
Dan Wahlin
 
JavaScript Patterns and Principles
JavaScript Patterns and PrinciplesJavaScript Patterns and Principles
JavaScript Patterns and Principles
Aaronius
 
Intro to AngularJS
Intro to AngularJSIntro to AngularJS
Intro to AngularJS
Aaronius
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0
Nagaraju Sangam
 
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
Ajax on drupal the right way - DrupalCamp Campinas, São Paulo, Brazil 2016
Nicolás Bouhid
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS
OrisysIndia
 
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Introduction to Magento 2 module development - PHP Antwerp Meetup 2017
Joke Puts
 
Dicoding Developer Coaching #21: Android | Cara Membuat Widget di Aplikasi An...
Dicoding Developer Coaching #21: Android | Cara Membuat Widget di Aplikasi An...Dicoding Developer Coaching #21: Android | Cara Membuat Widget di Aplikasi An...
Dicoding Developer Coaching #21: Android | Cara Membuat Widget di Aplikasi An...
DicodingEvent
 
Different way to share data between controllers in angular js
Different way to share data between controllers in angular jsDifferent way to share data between controllers in angular js
Different way to share data between controllers in angular js
codeandyou forums
 
Fast Prototyping Strategies for UI design
Fast Prototyping Strategies for UI designFast Prototyping Strategies for UI design
Fast Prototyping Strategies for UI design
Luis Daniel Rodriguez
 
Manipulating Magento - Meet Magento Belgium 2017
Manipulating Magento - Meet Magento Belgium 2017Manipulating Magento - Meet Magento Belgium 2017
Manipulating Magento - Meet Magento Belgium 2017
Joke Puts
 

Similar to Building Custom Controls to Visualize Data (UI5Con 2016 Frankfurt) (20)

Dmm212 – Sap Hana Graph Processing
Dmm212 – Sap Hana  Graph ProcessingDmm212 – Sap Hana  Graph Processing
Dmm212 – Sap Hana Graph Processing
Luc Vanrobays
 
Java Script Isn\'t a Toy Anymore
Java Script Isn\'t a Toy AnymoreJava Script Isn\'t a Toy Anymore
Java Script Isn\'t a Toy Anymore
Alexis Williams
 
7 Habits of Highly Efficient Visualforce Pages
7 Habits of Highly Efficient Visualforce Pages7 Habits of Highly Efficient Visualforce Pages
7 Habits of Highly Efficient Visualforce Pages
Salesforce Developers
 
Integrate Sas With Google Maps
Integrate Sas With Google MapsIntegrate Sas With Google Maps
Integrate Sas With Google Maps
vineetkaul
 
Introduction to the Wave Platform API
Introduction to the Wave Platform APIIntroduction to the Wave Platform API
Introduction to the Wave Platform API
Salesforce Developers
 
SAP HANA SPS09 - XS Programming Model
SAP HANA SPS09 - XS Programming ModelSAP HANA SPS09 - XS Programming Model
SAP HANA SPS09 - XS Programming Model
SAP Technology
 
What's New in SAP HANA SPS 11 DB Control Center (Operations)
What's New in SAP HANA SPS 11 DB Control Center (Operations)What's New in SAP HANA SPS 11 DB Control Center (Operations)
What's New in SAP HANA SPS 11 DB Control Center (Operations)
SAP Technology
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworks
Eric Guo
 
ITCamp 2018 - Magnus Mårtensson - Azure Resource Manager For The Win
ITCamp 2018 - Magnus Mårtensson - Azure Resource Manager For The WinITCamp 2018 - Magnus Mårtensson - Azure Resource Manager For The Win
ITCamp 2018 - Magnus Mårtensson - Azure Resource Manager For The Win
ITCamp
 
C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto SugishitaC13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
Insight Technology, Inc.
 
GlueCon 2016 - Threading in JavaScript
GlueCon 2016 - Threading in JavaScriptGlueCon 2016 - Threading in JavaScript
GlueCon 2016 - Threading in JavaScript
Jonathan Baker
 
Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)
Julien SIMON
 
Vaadin Components
Vaadin ComponentsVaadin Components
Vaadin Components
Joonas Lehtinen
 
Dynamic Data Visualization With Chartkick
Dynamic Data Visualization With ChartkickDynamic Data Visualization With Chartkick
Dynamic Data Visualization With Chartkick
Dax Murray
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
Eliran Eliassy
 
Lessons Learned Using Apache Spark for Self-Service Data Prep in SaaS World
Lessons Learned Using Apache Spark for Self-Service Data Prep in SaaS WorldLessons Learned Using Apache Spark for Self-Service Data Prep in SaaS World
Lessons Learned Using Apache Spark for Self-Service Data Prep in SaaS World
Databricks
 
"Lessons learned using Apache Spark for self-service data prep in SaaS world"
"Lessons learned using Apache Spark for self-service data prep in SaaS world""Lessons learned using Apache Spark for self-service data prep in SaaS world"
"Lessons learned using Apache Spark for self-service data prep in SaaS world"
Pavel Hardak
 
SLDS and Lightning Components
SLDS and Lightning ComponentsSLDS and Lightning Components
SLDS and Lightning Components
Salesforce Developers
 
Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012
hwilming
 
SAP HANA SPS10- Extended Application Services (XS) Programming Model
SAP HANA SPS10- Extended Application Services (XS) Programming ModelSAP HANA SPS10- Extended Application Services (XS) Programming Model
SAP HANA SPS10- Extended Application Services (XS) Programming Model
SAP Technology
 
Dmm212 – Sap Hana Graph Processing
Dmm212 – Sap Hana  Graph ProcessingDmm212 – Sap Hana  Graph Processing
Dmm212 – Sap Hana Graph Processing
Luc Vanrobays
 
Java Script Isn\'t a Toy Anymore
Java Script Isn\'t a Toy AnymoreJava Script Isn\'t a Toy Anymore
Java Script Isn\'t a Toy Anymore
Alexis Williams
 
7 Habits of Highly Efficient Visualforce Pages
7 Habits of Highly Efficient Visualforce Pages7 Habits of Highly Efficient Visualforce Pages
7 Habits of Highly Efficient Visualforce Pages
Salesforce Developers
 
Integrate Sas With Google Maps
Integrate Sas With Google MapsIntegrate Sas With Google Maps
Integrate Sas With Google Maps
vineetkaul
 
Introduction to the Wave Platform API
Introduction to the Wave Platform APIIntroduction to the Wave Platform API
Introduction to the Wave Platform API
Salesforce Developers
 
SAP HANA SPS09 - XS Programming Model
SAP HANA SPS09 - XS Programming ModelSAP HANA SPS09 - XS Programming Model
SAP HANA SPS09 - XS Programming Model
SAP Technology
 
What's New in SAP HANA SPS 11 DB Control Center (Operations)
What's New in SAP HANA SPS 11 DB Control Center (Operations)What's New in SAP HANA SPS 11 DB Control Center (Operations)
What's New in SAP HANA SPS 11 DB Control Center (Operations)
SAP Technology
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworks
Eric Guo
 
ITCamp 2018 - Magnus Mårtensson - Azure Resource Manager For The Win
ITCamp 2018 - Magnus Mårtensson - Azure Resource Manager For The WinITCamp 2018 - Magnus Mårtensson - Azure Resource Manager For The Win
ITCamp 2018 - Magnus Mårtensson - Azure Resource Manager For The Win
ITCamp
 
C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto SugishitaC13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
Insight Technology, Inc.
 
GlueCon 2016 - Threading in JavaScript
GlueCon 2016 - Threading in JavaScriptGlueCon 2016 - Threading in JavaScript
GlueCon 2016 - Threading in JavaScript
Jonathan Baker
 
Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)Automate your Amazon SageMaker Workflows (July 2019)
Automate your Amazon SageMaker Workflows (July 2019)
Julien SIMON
 
Dynamic Data Visualization With Chartkick
Dynamic Data Visualization With ChartkickDynamic Data Visualization With Chartkick
Dynamic Data Visualization With Chartkick
Dax Murray
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
Eliran Eliassy
 
Lessons Learned Using Apache Spark for Self-Service Data Prep in SaaS World
Lessons Learned Using Apache Spark for Self-Service Data Prep in SaaS WorldLessons Learned Using Apache Spark for Self-Service Data Prep in SaaS World
Lessons Learned Using Apache Spark for Self-Service Data Prep in SaaS World
Databricks
 
"Lessons learned using Apache Spark for self-service data prep in SaaS world"
"Lessons learned using Apache Spark for self-service data prep in SaaS world""Lessons learned using Apache Spark for self-service data prep in SaaS world"
"Lessons learned using Apache Spark for self-service data prep in SaaS world"
Pavel Hardak
 
Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012Integrating SAP the Java EE Way - JBoss One Day talk 2012
Integrating SAP the Java EE Way - JBoss One Day talk 2012
hwilming
 
SAP HANA SPS10- Extended Application Services (XS) Programming Model
SAP HANA SPS10- Extended Application Services (XS) Programming ModelSAP HANA SPS10- Extended Application Services (XS) Programming Model
SAP HANA SPS10- Extended Application Services (XS) Programming Model
SAP Technology
 
Ad

Recently uploaded (20)

The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Ad

Building Custom Controls to Visualize Data (UI5Con 2016 Frankfurt)

  • 1. Public Building Custom Controls to Visualize Data Maximilian Lenkeit @mlenkeit
  • 2. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 2Public@mlenkeit Disclaimer This presentation outlines our general product direction and should not be relied on in making a purchase decision. This presentation is not subject to your license agreement or any other agreement with SAP. SAP has no obligation to pursue any course of business outlined in this presentation or to develop or release any functionality mentioned in this presentation. This presentation and SAP's strategy and possible future developments are subject to change and may be changed by SAP at any time for any reason without notice. This document is provided without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP assumes no responsibility for errors or omissions in this document, except if such damages were caused by SAP intentionally or grossly negligent.
  • 3. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 3Public@mlenkeit Agenda Introduction Example: Connected Shipping Containers Visualizations in SAPUI5 Key Takeaways
  • 4. Public Connected Shipping Containers An Example for Custom Visualizations in SAP Fiori-like Apps
  • 5. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 5Public@mlenkeit Scenario Description Port operator Containers equipped with sensors  Protect against theft  Track damage  Maintain cold chain
  • 6. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 6Public@mlenkeit Technical Setup
  • 7. © 2015 SAP SE or an SAP affiliate company. All rights reserved. 7Public
  • 9. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 9Public@mlenkeit Scalable Vector Graphics Similar to HTML  XML-based  CSS for styling Common shapes  Path  Circle  Rectangle  Group  … <svg> <rect width="20" height="90" x="0" transform="translate(0, 0)"></rect> <rect width="20" height="85" x="25" transform="translate(0, 5)"></rect> <rect width="20" height="80" x="50" transform="translate(0, 10)"></rect> </svg> rect { fill: rgb(240,171,0); } + =
  • 10. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 10Public@mlenkeit Open Source Library D3.js References  VizFrame  Hundreds of examples online Key Features  Low-level APIs  Data binding var selSvg = d3.select("#svg"); var aData = [ {x:30}, {x:25}, {x:20} ]; var selRects = selSvg.selectAll("rect").data(aData); selRects.enter().append("rect") .attr("width", 20) .attr("height", function(d) { return d.x; }) .attr("x", function(d, i) { return i * 25; }); <svg id="svg"> <rect width="20" height="30" x="0"></rect> <rect width="20" height="25" x="25"></rect> <rect width="20" height="20" x="50"></rect> </svg> = =
  • 11. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 11Public@mlenkeit Recommendations for Creating Visualizations in SAPUI5 Do’s  Wrap visualization into custom control  Integrate with SAPUI5 data binding  Use theme parameters  Make it responsive Don’ts  Re-render from scratch
  • 12. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 12Public@mlenkeit Wrapping Visualization Into Custom Control Benefits  Use in XML views  Leverage data binding  Reuse DOM Checklist  Use sap.ui.core.HTML to render a container  Render in container from onAfterRendering <Page title="Dashboard"> <custom:CustomChart ... /> </Page>
  • 13. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 13Public@mlenkeit Code Sample for Custom Control Skeleton Control.extend("CustomChart", { metadata : { aggregations : { _html : { type : "sap.ui.core.HTML", multiple : false, visibility : "hidden" } } }, init : function() { this._sContainerId = this.getId() + "--container"; this.setAggregation("_html", new sap.ui.core.HTML({ content : "<svg id='" + this._sContainerId + "'></svg>" })); }, renderer : function(oRm, oControl) { oRm.write("<div"); oRm.writeControlData(oControl); oRm.write(">"); oRm.renderControl(oControl.getAggregation("_html")); oRm.write("</div>"); }, onAfterRendering : function() { var aData = [ {x:30}, {x:25}, {x:20} ]; var selRects = d3.select("#" + this._sContainerId).selectAll("rect").data(aData); selRects.enter().append("rect").attr("width", 20)/*...*/; } });
  • 14. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 14Public@mlenkeit Integrating with SAPUI5 Data Binding What we’d like to do Benefits  Use with different data  Abstract data source  Standard sorting and filtering var oModel = new JSONModel({ data : [ {x:30}, {x:25}, {x:20} ] }); var oControl = new CustomChart({ data : { path: '/data' } }); oControl.setModel(oModel);
  • 15. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 15Public@mlenkeit Code Sample for Integrating D3.js Data Binding with SAPUI5 Control.extend("CustomChart", { metadata : { aggregations : { data : { type : "sap.ui.base.ManagedObject" } } }, // ... onAfterRendering : function() { var aData = this.getBinding("data").getContexts().map(function(oContext) { return oContext.getObject(); }); // d3.js rendering logic } }); var oModel = new JSONModel({ data : [ {x:30}, {x:25}, {x:20} ] }); var oControl = new CustomChart({ data : { path: '/data' } }); oControl.setModel(oModel); var oModel = new JSONModel({ data : [ {x:30}, {x:25}, {x:20} ] }); var oControl = new CustomChart({ data : { path: '/data', template : new sap.ui.base.ManagedObject() } }); oControl.setModel(oModel);
  • 16. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 16Public@mlenkeit Using Theme Parameters Benefits  Consistent with theme  Leverage color dependencies Example Hint sap.ui.core.theming.Parameters.get() returns all parameters onAfterRendering : function() { var aData = [ {x:30}, {x:25}, {x:20} ]; var selRects = d3.select("#" + this._sContainerId).selectAll("rect").data(aData); selRects.enter().append("rect").attr("width", 20)/*...*/ .attr("fill", function(d, i) { return sap.ui.core.theming.Parameters.get("sapUiChart" + i); }); }
  • 17. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 17Public@mlenkeit Make It Responsive Benefits  Enable control for different screen sizes  Improve user experience per device Example onAfterRendering : function() { this._sResizeHandlerId = sap.ui.core.ResizeHandler.register(this, jQuery.proxy(this._onResize, this)); }, onBeforeRendering : function() { sap.ui.core.ResizeHandler.deregister(this._sResizeHandlerId); }, exit : function() { sap.ui.core.ResizeHandler.deregister(this._sResizeHandlerId); }, _onResize : function(oEvent) { // oEvent.size.width // oEvent.size.height }
  • 18. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 18Public@mlenkeit Re-rendering from Scratch Problem DOM operations expensive HTML control retains DOM No re-render required Recommended pattern onAfterRendering : function() { if (this.bSetupDone !== true) { // create static parts like axis, backgrounds, etc. this.bSetupDone = true; } // update the moving parts }
  • 19. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 19Public@mlenkeit Recommendations for Creating Visualizations in SAPUI5 Do’s  Wrap visualization into custom control  Integrate with SAPUI5 data binding  Use theme parameters  Make it responsive Don’ts  Re-render from scratch
  • 22. © 2016 SAP SE or an SAP affiliate company. All rights reserved. 22Public@mlenkeit Key Takeaways Custom visualizations  Easy to build and integrate with SAPUI5  Help to tailor an app to the user’s needs Try it yourself  Take the scaffold  Get creative!
  • 23. © 2015 SAP SE or an SAP affiliate company. All rights reserved. Thank you Contact information: Maximilian Lenkeit Senior Developer, SAP Custom Development Twitter: @mlenkeit