• This repository has been archived on 24/May/2022
  • Stars
    star
    179
  • Rank 206,398 (Top 5 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created almost 10 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Yeoman generator to help customize Esri's WebAppBuilder

Archived: this project has been archived. For help getting started building Web AppBuilder widgets, see Widget Development and Theme Development on the official documentation site.

generator-esri-appbuilder-js Build Status

Yeoman generator to help customize the ArcGIS Web AppBuilder.

About

This generator scaffolds out the boilerplate files that are needed when you are customizing the Web AppBuilder. This includes generators to set up your project and scaffold out the files needed to create custom widgets.

Screenshot

Getting Started

Installation

The first prerequisite is to have the grunt-cli installed. To install this, run:

npm install -g grunt-cli

Next you must install Yeoman:

$ npm install -g yo

Finally install generator-esri-appbuilder-js from npm:

$ npm install -g generator-esri-appbuilder-js

Running the Generators

The generators should be run in the root of a working folder for your project. This should be outside of the Web AppBuilder's folder structure (i.e. NOT in the stem app or an app that you've already created with the Web AppBuilder). The grunt tasks configured by the generators will handle copying the widget files to the appropriate folders under the Web AppBuilder's install directory. Because of this, the generator will ask you what app to use. If you select None or do not have any Web AppBuilder apps in your Web AppBuilder install directory, the grunt file will be created but will not be configured to copy your code to the appropriate app directory. If you create an app after running the Yeoman generator, you can either go to the Gruntfile and make manual edits (you'll see details in there), or you can re-run this generator and it will offer to overwrite your Gruntfile.

App (Default) Generator

The app generator installs and configures the grunt tasks and other project files and ensures that required subfolders (like widgets) exist.

  1. Navigate into the root folder of your project
  2. Run the generator with yo esri-appbuilder-js
  3. Answer the man's questions!
Prompt Description Default
Type of widget(s) to be generated Whether you want to build 2D or 3D widgets 2D
Web AppBuilder install root The root folder where you installed (unzipped) the Web AppBuilder Developer Edition [USER_HOME_FOLDER]/WebAppBuilderForArcGIS
Web AppBuilder application The name of the application you would like the grunt task to sync your code with None
Would you like to use SASS for CSS preprocessing? If you choose yes, you can utilize features from SASS like nesting, variables, etc. Yes
Which JavaScript syntax version would you like to develop in? Will widget and settings JavaScript files use ES5, ES2015, or TypeScript? ES5

Widget Generator

Scaffolds out the files needed to create a new custom widget.

  1. Navigate into the root folder of your project
  2. Run the generator with yo esri-appbuilder-js:widget
  3. Answer the man's questions!
Prompt Description Default
Widget Name Folder name for output files and widget identifier MyWidget
Widget Title Name users see in widget selector and panel title bar My Widget
Description What does this widget do? (optional) A custom Web AppBuilder widget
Base Class The widget's base class my-widget
Run inside a panel Will your widget run inside a panel? Yes
Locale (i18n) file Will your widget require a locale file? Yes
Style (CSS) file Will your widget require a style file? Yes
Config (JSON) file Will your widget require a configuration file? Yes
Template (HTML) file Will your widget require a template file? Yes
Would you like a settings page? Will your widget have a settings page? Yes
Settings template (HTML) file Will your settings page require a template file? Yes
Settings locale (i18n) file Will your settings page require a locale file? Yes
Settings style (CSS) file Will your settings page require a style file? Yes

Taking the default values for the prompts will generate the following output under the widgets folder (note: if you choose TypeScript style, there will be .ts files instead of JS):

MyWidget
β”‚   config.json
β”‚   manifest.json
β”‚   Widget.html
β”‚   Widget.js
β”‚
β”œβ”€β”€β”€css
β”‚       style.css (or style.scss)
β”‚
β”œβ”€β”€β”€images
β”‚       icon.png
β”‚
β”œβ”€β”€β”€nls
β”‚       strings.js
β”‚
└───setting
    |   Setting.js
    |   Setting.html
    β”œβ”€β”€β”€nls
    |       strings.js
    └───css
            style.css

After you copy the widget files to the Web AppBuilder's stemapp, the next time you run the Web AppBuilder, you will see something like the following on the widgets panel:

Widget in the Builder

Optional Settings

Users are also able to scaffold out widgets without creating an application base. When running yo esri-appbuilder-js:widget from a root without an existing .yo-rc.json file, these additional questions will be asked prior to the questions above.

Prompt Description Default
Choose your widget directory The location you want your widgt to be built. E.g ./ for root None
Type of widget(s) to be generated Whether you want to build 2D or 3D widgets 2D
Would you like to use SASS for CSS preprocessing? If you choose yes, you can utilize features from SASS like nesting, variables, etc. Yes
Which JavaScript syntax version would you like to develop in? Will widget and settings JavaScript files use ES5, ES2015, or TypeScript? ES5

Copying Widget Files

In order for the widgets that you're working on to be available in the Web AppBuilder you will need to copy their files to the appropriate folder under the Web AppBuilder's install root.

Copying the Files Manually

For example, let's say you've installed the Web AppBuilder in c:\WebAppBuilderForArcGIS, then you'll need to copy widget files to the following folder under the stem app:

c:\WebAppBuilderForArcGIS\client\stemapp\widgets

Also, you'll likely want to copy widget files to any applications that you've created that use them:

c:\WebAppBuilderForArcGIS\server\apps\[appId]\widgets

Unless you're using the grunt tasks, you'll need to re-copy the files each time you make changes to the files.

Running the Grunt Tasks

The easiest way to keep your widget files in sync with the Web AppBuilder is to run the grunt tasks. After running the generators, you can run the default grunt task following at the project root:

grunt

This will copy over any files that haven't already been copied over, and then start watching all files under the widgets folder for changes and re-copy the files to the Web AppBuilder's folders.

Livereload

The generator enables Livereload by default in the Gruntfile that it creates. This means the Grunt watch task will run at the default livereload port so you can use a browser extension to have the page reload when you save your source widget files. See grunt-contrib-watch for advanced customization. Extensions are available in all major browsers (Example for Google Chrome)

Linting Your Code

The app generator does not scaffold out any linting files. We recommend that you use some form of linting, either jshint, semistandard, or eslint. An example of using semistandard is below:

  1. Install semistandard:
npm install -g semistandard
  1. Below is a sample configuration you can add to your package.json:
  "semistandard": {
    "globals": [
      "define"
    ],
    "ignore": [
      "Gruntfile.js",
      "**/dist/**/*.js"
    ]
  }
  1. Validate your code:
semistandard

See the semistandard docs for more information.

TypeScript

If you choose TypeScript as the answer to the Which JavaScript syntax version would you like to develop in?, the TypeScript compiler will be used to build your Widget TypeScript file into an AMD Widget JS file that Web AppBuilder is expecting. There are a few considerations to understand when doing this.

Widgets in Template

If you add templated widgets to your html (ex: <div data-dojo-type="dijit/layout/AccordionPane" title="pane #1">accordion pane #1</div>), you both need to mix in the template:

@declare(BaseWidget, _WidgetsInTemplateMixin)
class Widget implements IWidget {

AND call the startup of _WidgetsInTemplateMixin

 public startup(args: any): void {
    BaseWidget.prototype.startup.call(this, args);
    _WidgetsInTemplateMixin.prototype.startup.call(this, args);

See here for more information on this pattern.

Building for Production

When you're ready to publish your application in a user facing environment, improve performance by running:

npm run build

The resulting package can be found in dist/buildOut/app.zip

This will repackage and compress your application with only the neccessary elements. We have found this to result in massive performance improvements.

NOTE: This feature is only available for 2D applications with a chosen Web AppBuilder application.

System Requirements

We aim to support LTS versions of Node.js. Right now that means Node.js v8.0 and heigher.

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

We welcome contributions from anyone and everyone. Please see Esri's guidelines for contributing.

Credit

This generator was inspired by @steveoh and @stdavis's generator-dojo-widget as well as @dbouwman's generator-bootmap.

Licensing

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's license.txt file.

More Repositories

1

arcgis-python-api

Documentation and samples for ArcGIS API for Python
Python
1,766
star
2

esri-leaflet

A lightweight set of tools for working with ArcGIS services in Leaflet. πŸš€
JavaScript
1,551
star
3

wind-js

An demo animation of wind on a Canvas layer in the JSAPI
JavaScript
690
star
4

geometry-api-java

The Esri Geometry API for Java enables developers to write custom applications for analysis of spatial data. This API is used in the Esri GIS Tools for Hadoop and other 3rd-party data processing solutions.
Java
679
star
5

jsapi-resources

A collection of useful resources for developers using the ArcGIS API for JavaScript.
JavaScript
675
star
6

terraformer

A geographic toolkit for dealing with geometry, geography, formats, and building geo databases
JavaScript
673
star
7

arcgis-runtime-samples-android

ArcGIS Runtime SDK for Android Samples
Java
656
star
8

esri.github.io

Esri GitHub landing page
JavaScript
510
star
9

gis-tools-for-hadoop

The GIS Tools for Hadoop are a collection of GIS tools for spatial analysis of big data.
507
star
10

esri-loader

A tiny library to help load ArcGIS API for JavaScript modules in non-Dojo applications
TypeScript
451
star
11

arcgis-js-api

Minified version of the ArcGIS API for JavaScript
SCSS
391
star
12

arcgis-maps-sdk-dotnet-samples

Sample code for ArcGIS Maps SDK for .NET – WPF, WinUI, .NET MAUI
C#
386
star
13

arcgis-osm-editor

ArcGIS Editor for OpenStreetMap is a toolset for GIS users to access and contribute to OpenStreetMap through their Desktop or Server environment.
C#
381
star
14

resource-proxy

Proxy files for DotNet, Java and PHP.
PHP
370
star
15

bootstrap-map-js

A light-weight JS/CSS extension for building awesome mapping apps with Bootstrap and ArcGIS.
HTML
366
star
16

deep-learning-frameworks

Installation support for Deep Learning Frameworks for the ArcGIS System
358
star
17

spatial-framework-for-hadoop

The Spatial Framework for Hadoop allows developers and data scientists to use the Hadoop data processing system for spatial data analysis.
Java
354
star
18

arcgis-rest-js

compact, modular JavaScript wrappers for the ArcGIS REST API
TypeScript
335
star
19

arcgis-runtime-samples-ios

Swift samples demonstrating various capabilities of ArcGIS Runtime SDK for iOS
Swift
322
star
20

react-arcgis

A few components to help you get started using the ArcGIS API for JavaScript and esri-loader with React
TypeScript
314
star
21

i3s-spec

This repository hosts the specification for Scene Layers which are containers for arbitrarily large amounts of geographic data. The delivery and persistence model for Scene Layers, referred to as Indexed 3d Scene Layer (I3S) and Scene Layer Package (SLPK) respectively, are specified.
310
star
22

arcgis-pro-sdk

ArcGIS Pro SDK for Microsoft .NET is the new .NET SDK for the ArcGIS Pro Application.
282
star
23

arcgis-cookbook

Chef cookbooks for ArcGIS
Ruby
274
star
24

developer-support

Proof of concept developer code and samples to help be successful with all ArcGIS developer products (Python, NET, JavaScript, Android…). The repository is designed to be an exchange for sharing coding conventions and wisdom to developers at all skill levels.
C#
258
star
25

calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
TypeScript
252
star
26

cedar

JavaScript Charts for ArcGIS
Handlebars
250
star
27

arcade-expressions

ArcGIS Arcade expression templates for all supported profiles in the ArcGIS platform.
JavaScript
246
star
28

geoportal-server

Geoportal Server is a standards-based, open source product that enables discovery and use of geospatial resources including data and services.
C#
242
star
29

calcite-maps

A Bootstrap theme for designing, styling and creating modern map apps.
JavaScript
237
star
30

esri-leaflet-geocoder

helpers for using the ArcGIS World Geocoding Service in Leaflet
JavaScript
227
star
31

quickstart-map-js

ArcGIS JavaScript mapping samples to get you started fast.
HTML
218
star
32

angular-esri-map

A collection of directives to help you use Esri maps and services in your Angular applications
JavaScript
213
star
33

arcgis-pro-sdk-community-samples

ArcGIS Pro SDK for Microsoft .NET Framework Community Samples
C#
210
star
34

vitruvio

Vitruvio brings the powerful ArcGIS CityEngine procedural modeling capabilities to Unreal Engine.
C++
204
star
35

awesome-arcgis-developers

A curated list of resources to help you with ArcGIS development, APIs, SDKs, tools, and location services
198
star
36

arcgis-maps-sdk-dotnet-toolkit

Toolkit for ArcGIS Maps SDK for .NET
C#
198
star
37

cityengine-sdk

CityEngine is a 3D city modeling software for urban design, visual effects, and VR/AR production. With its C++ SDK you can create plugins and standalone apps capable to execute CityEngine CGA procedural modeling rules.
197
star
38

ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Python
194
star
39

raster-functions

A curated set of lightweight but powerful tools for on-the-fly image processing and raster analysis in ArcGIS.
Python
188
star
40

arcgis-to-geojson-utils

Tools to convert ArcGIS JSON geometries to GeoJSON geometries and vice-versa.
JavaScript
186
star
41

raster-deep-learning

ArcGIS built-in python raster functions for deep learning to get you started fast.
Python
180
star
42

lerc

Limited Error Raster Compression
C++
179
star
43

public-transit-tools

Tools for working with GTFS public transit data in ArcGIS
Python
159
star
44

geodev-hackerlabs

A place to learn how to build geo apps with the ArcGIS Platform.
HTML
157
star
45

offline-editor-js

ArcGIS JavaScript library for handling offline editing and tiling.
JavaScript
156
star
46

storymap-tour

The Story Map Tour is ideal when you want to present a linear, place-based narrative featuring images or videos.
JavaScript
149
star
47

ago-assistant

A swiss army knife for your ArcGIS Online and Portal for ArcGIS accounts
JavaScript
149
star
48

arcgis-js-cli

CLI to build a template application and widgets using the ArcGIS API for JavaScript
TypeScript
137
star
49

arcgis-viewer-flex

Source code for ArcGIS Viewer for Flex - a great application framework for web applications.
ActionScript
135
star
50

arcgis-webpack-plugin

Webpack plugin for the ArcGIS API for JavaScript
JavaScript
134
star
51

joint-military-symbology-xml

Joint Military Symbology Markup Language is a data encapsulation of MIL-STD-2525D and APP-6(D).
C#
134
star
52

file-geodatabase-api

FileGeodatabaseAPI_1.4 (1.4.0.183) The File Geodatabase C++ API for Windows, MacOS and Linux
131
star
53

solutions-geoprocessing-toolbox

Models, scripts, and tools for use in ArcGIS Desktop and Server to support defense and intelligence workflows.
Python
131
star
54

arcgis-maps-sdk-samples-qt

ArcGIS Maps SDK for Qt Samples
C++
129
star
55

geojson-layer-js

An easy way to load GeoJSON data into your ArcGIS map
JavaScript
126
star
56

geojson-utils

A set of utilities for converting between standard geojson and other json formats
JavaScript
123
star
57

arcobjects-sdk-community-samples

This repo contains the source code samples (.Net c#, .Net vb, and C++) that demonstrate the usage of the ArcObject SDK.
C#
118
star
58

ago-admin-wiki

A collection of code samples, scripts, hacks, tools, and information for ArcGIS Online administrators.
117
star
59

OptimizeRasters

OptimizeRasters is a set of tools for converting raster data to optimized Tiled TIF or MRF files, moving data to cloud storage, and creating Raster Proxies.
HTML
115
star
60

arcgis-maps-sdk-toolkit-qt

ArcGIS Maps SDK for Qt Toolkit
C++
112
star
61

android-gps-test-tool

Test all aspects of Android's location capabilities. Configurable for trying out different scenarios.
Java
111
star
62

calcite-web

Authoritative front-end development resources for Calcite design initiative. Includes extendable base components and styles, as well as a modular and efficient framework for ArcGIS properties.
SCSS
107
star
63

arcgis-maps-sdk-java-samples

ArcGIS Maps SDK for Java samples
Java
106
star
64

arcgis-experience-builder-sdk-resources

ArcGIS Experience Builder samples
TypeScript
105
star
65

arcgis-powershell-dsc

This repository contains scripts, code and samples for automating the install and configuration of ArcGIS (Enterprise and Desktop) using Microsoft Windows PowerShell DSC (Desired State Configuration).
PowerShell
105
star
66

maps-app-android

Your organisations mapping app built with the runtime SDK for android
Java
101
star
67

palladio

Palladio enables the execution of CityEngine CGA rules inside of SideFX Houdini.
C++
100
star
68

storymap-journal

The Story Map Journal is ideal when you want to combine narrative text with maps and other embedded content.
JavaScript
97
star
69

arcgis-maps-sdk-unity-samples

Sample code for the ArcGIS Maps SDK for Unity.
C#
96
star
70

arcgis-appstudio-samples

Collection of samples available in AppStudio for ArcGIS desktop to learn and help build your next app.
QML
96
star
71

storymap-cascade

The Story Map Cascadeβ„  app lets you combine narrative text with maps, images, and multimedia content in an engaging, full-screen scrolling experience.
JavaScript
94
star
72

dojo-theme-flat

Custom flat theme based on Twitter's Bootstrap for Dojo dijits, dgrid, and esri widgets.
CSS
92
star
73

html5-geolocation-tool-js

Mobile ArcGIS API for JavaScript samples for testing various geolocation configurations.
HTML
92
star
74

application-boilerplate-3x-js

Starter application that simplifies the process of building templates for the ArcGIS.com template gallery.
JavaScript
89
star
75

angular-cli-esri-map

Example Angular component for building mapping applications with the ArcGIS API for JavaScript
TypeScript
88
star
76

arcgis-vectortile-style-editor

A simple Vector Tile Style Editor to update the styles of Esri Vector Basemaps
CSS
88
star
77

feedback-js-api-next

Try out the next release of the ArcGIS Maps SDK for JavaScript and share your feedback. Be warned: this release is still in development and is unstable.
86
star
78

geoportal-server-catalog

Esri Geoportal Server is a next generation open-source metadata catalog and editor, based on elasticsearch.
JavaScript
85
star
79

ago-tools

A Python package to assist with administering ArcGIS Online Organizations.
Python
77
star
80

workforce-scripts

A set of scripts to help administer Workforce projects.
Jupyter Notebook
77
star
81

esri-leaflet-doc

Documentation, API Reference and Samples
Handlebars
77
star
82

cordova-plugin-advanced-geolocation

Highly configurable native Android interface to both GPS and NETWORK on-device location providers.
Java
74
star
83

maps-app-javascript

Your organizations maps app built with ArcGIS API for Javascript
TypeScript
73
star
84

terraformer-wkt-parser

Well-Known Text parser for Terraformer
JavaScript
71
star
85

geoprocessing-tools-for-hadoop

The Hadoop GP Toolbox provides tools to exchange features between a Geodatabase and Hadoop and run Hadoop workflow jobs.
Python
71
star
86

dojo-bootstrap-map-js

Samples for how to use the Esri ArcGIS API for JavaScript w/ Bootstap via Dojo-bootstrap
JavaScript
71
star
87

collector-tools

A set of python scripts and geoprocessing tools to automate common tasks and workflows in conjunction with Collector for ArcGIS
Python
71
star
88

public-information-map-template-js

An ArcGIS Online mapping template to showcase social media on a map for disaster response and public information.
JavaScript
69
star
89

geoform-template-js

GeoForm is a configurable template for form based data editing of a Feature Service.
JavaScript
66
star
90

webhooks-samples

Sample receivers, scripts, and workflows to help you get started with Webhooks in ArcGIS Enterprise
Python
66
star
91

react-redux-js4

Boilerplate ArcGIS JS API 4.x app using React and Redux
JavaScript
66
star
92

arcgis-maps-sdk-unreal-engine-samples

Sample code for the ArcGIS Maps SDK for Unreal Engine.
C++
65
star
93

arcgis-maps-sdk-dotnet-demos

Demo applications provided by the ArcGIS Runtime SDK for .NET Team
C#
63
star
94

node-geoservices-adaptor

This is a node.js implementation of the ArcGIS REST API
JavaScript
63
star
95

storymap-series

The Story Map Series lets you present a series of maps via tabs, numbered bullets, or a side accordion.
JavaScript
63
star
96

cluster-layer-js

One example of how to cluster many point features
JavaScript
62
star
97

mdcs-py

MDCS is an acronym for Mosaic Dataset Configuration Script and is the entry point to a collection of Python classes/libraries that could be consumed by a Python client application to complete a given workflow for creating a mosaic dataset, populating it with data, and setting all required/desired parameters.
Python
62
star
98

calcite-ui-icons

A collection of UI icons built by Esri for applications.
JavaScript
61
star
99

nearby-android

ArcGIS Android app to find places nearby and route to the nearest location.
Java
60
star
100

local-government-desktop-addins

A series of ArcGIS Desktop Add-ins used in the ArcGIS for Local Government editing maps.
C#
60
star