28
Extending the ArcGIS API for JavaScript Widgets Learn how to take an out-of-the-box widget and customize it to your heart's content Matt Driscoll – @driskull JC Franco – @arfncode

Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

  • Upload
    others

  • View
    17

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Extending the ArcGIS API for JavaScriptWidgets

Learn how to take an out-of-the-box widget and customize it to your heart's content

Matt Driscoll – @driskullJC Franco – @arfncode

Page 2: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Hello World

Page 3: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Why are we here?Learn how to extend and customize widgets

Focus on 4.x API

Make them unique!

Page 4: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

ExtendVerbto enlarge the scope of, or make more comprehensive, asoperations, influence, or meaning:

http://dictionary.reference.com/browse/extend

Page 5: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

AgendaTake Widgets

CustomizeRestyleTheme

ExtendCustom view

Different CSS LibraryDifferent Framework

Modify existing functionality

Page 7: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

It's cool, but...

Doesn't match myFrameworkCSS LibraryBrandEtc.

Page 8: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

We're SASSy is a scripting language that is interpreted into Cascading Style Sheets (CSS)Sass

Page 9: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Why SASS?SASS gives us...

VariablesMixins (group statements)@include - (getting mixins)@import@extend - (inheritance)More power!

Page 10: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

SASS makes it easier to...RestyleThemeModular / DRYBe organizedWrite less code :)

Page 12: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Lets use the power of SASS and...Restyle the search widgetTheme stuff!

Page 13: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Next up, ExtendingLets do more!

but how?

Page 14: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

4.x Widget ArchitectureWidget Architecture

View – the faceViewModel – the brain

Reusable/Testable core widget logic sans UI concernsFramework compatibilitySeparates concerns

Page 15: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Comparison3.x 4.x

Page 16: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

ViewUses ViewModel APIs to render the UIView-specific logic resides here

Page 17: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

ViewModelCore logic of widget resides hereProvides necessary APIs for the view to do it's thingNo DOM/UI concerns (think data)Requires thinking, no silver-bullet

Page 18: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Custom Views!View customization via extensionView for Bootstrap (custom CSS classes)View for a framework (custom HTML/data binding or whatevs)

Page 21: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Custom View For Bootstrap

Page 24: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Let's SummarizeLearned how we can modify a widget's

StyleThemeView

Page 25: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Recommended sessionsArcGIS API for JavaScript: Discover 4.0 the Next GenerationThe Road Ahead: ArcGIS API for JavaScriptBuilding Your own Widget with ArcGIS API for JavaScriptUsing and Customizing the ArcGIS API for JavaScript WidgetsCSS: Rules to Style ByAccessible Web Mapping Apps: ARIA, WCAG and 508 ComplianceModern Tools for the Modern Web DeveloperOptimizing Your JavaScript App for PerformanceFull Stack End to End JavaScript Testing with InternUsing TypeScript with ArcGIS JS API DevelopmentWrite Better CodeAsk a UX & UI Expert

Page 26: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Additional ResourcesSource Code & PresentationJavaScript Sessions at DevSummitDocumentation - 4.0 beta

Page 27: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Rate Us!Esri Events Mobile App -

http://www.esri.com/events/eventsappiOSAndroid

Search for "Extending the ArcGIS API for JavaScript Widgets".

Page 28: Extending the ArcGIS API for JavaScript Widgets › library › userconf › dev...Widget Architecture View – the face ViewModel – the brain Reusable/Testable core widget logic

Q & AQuestions?