As featured at 2016 AWS Re:Invent
FacSearch is a web application that allows for easy querying and visualizing of AutoCAD floorplan drawings and related facilities and personnel data stored in elasticsearch. AutoCAD drawings are converted to SVG and attributes such as organizations, space types, people are represented visually as layers on top of a floorplan. The application provided here is a simple example, but this application is designed to integrate data from a variety of systems and connects them to floorplan visualizations. Examples of data sources include motion sensors, fire extinguishers, technical assets, people, room details (internet ports, projection capabilities), and 360 photos of lab spaces.
d3.floorplan.js from David Ciarletta
Milennium Falcon Demo (link: (coming soon)):
Space is a precious commodity at NASA's Jet Propulsion Laboratory (JPL). Limited spacial resources ensure that personnel, equipment, and material moves are considered at least on a weekly basis in order to facilitate ongoing work and research at the laboratory. The IT Data Science group has developed FacSearch to enable easy interpretation and understanding of space constraints, along with potential opportunities for moves that could improve organizational efficiency. This tool has also proven useful in providing administrative, maintenance and safety staff timely and relevant information.
FacSearch addresses three primary use cases: the ability to easily search and locate individuals, the ability to locate and visualize rooms and assets that match specific attributes, and the ability to gain deeper insights as to how physical space is being used.
Find people and visually represent their office's location on a floorplan.
The core functionality of the advanced search is the ability to search for rooms filtered by various attributes including:
- Minimum Square Footage
- Minimum Number of Results
- Space Type (escape pod, cockpit, etc.)
Attributes are limited only by data availability. Additionally, the query results can be shown as a grid with buildings ordered by number and floor, or through a visual representation using a bar chart.
Once a user selects a particular result, the floorplan of that particular building and floor is displayed, along with the results that match the user's query. The user can then hover over a room to view additional information, such as who that room is assigned to, square footage, the type of space, and other attributes:
Additional layers are available for floorplans as well:
- Space Type
- Extinguisher Type
- Floorplan (no data)
- CSV export of underlying data
The insights page is a place to generate reports and provide insights as to how physical space is being used within each organization, such as the amount of square footage per person, the ratio of available space to unavailable space, the number of public and private conference rooms available, etc. Whereas the personnel search satisfies the need to easily locate an individual and the advanced search satisfies the need to quickly locate types of spaces by attribute, the goal for the insights page is to showcase areas of opportunity and suggest actions that will improve how efficiently space is being used across the lab:
Getting Started with the Demo
Download and install elasticsearch-2.4
Run elasticsearch (defaults to port 9200):
cd <path to elasticsearch>/bin | ./elasticsearch
(To test that your elasticsearch instance is running, go to
http://localhost:9200 in your browser)
Bulk upload the sample Millenium Falcon index to your local elasticsearch instance
cd <path to facsearch>/data_scripts/ | python build_index.py
(To test that your index was pushed successfully, go to
http://localhost:9200/facsearch/?pretty in your browser)
Install python requirements (python 2.7.x)
pip install -r <path to facsearch>/requirements.txt
python <path to facsearch>/app.py
http://localhost:5005 in Chrome, Safari, or Firefox
(Docker instructions coming soon)
Raw AutoCAD files (.DWG) are converted to SVG using Benzesoft Easy CAD to SVG converter to convert all files (free 15-day trial, $99 purchase). This is the only solution we have found that suits our needs as it allows for specifying output dimensions (w: 800, h: 600).
Data integration should take place in
build_index.py as this is where JSON for elasticsearch index is being constructed. This script performs the identification of rooms and room numbers based on the SVG (converted from AutoCAD), then we generally join data from other sources using room number as the key. One JSON doc in the index represents a unique room. The way in which the SVG is parsed is fairly specific given the way our drawings are done, but some groundwork has been laid to customize this and extend it to other use cases.
To build and push your own index, the
build_json() function in
build_index.py will need to be run and the
push_to_es() function will beed to be uncommented. Right now the script is only pushing the sample index to elasticsearch and not construction from scratch. The Inkscape commandline tool will also need to be installed - Inkscape is used to convert the SVG to an image file for display in the application (via
To customize fields being pulled from elasticsearch and classes for displaying the data, several files will need to be changed as many of the definitions are explicit at this point. For the
query.js file located in
d3.floorplan.js the DRY principle was badly violated. Each
d3.floorplan.<name> function represents a layer on the floorplan visualization page, and specific layer classes and behaviors are defined in each of these functions.
CSS classes used in both the floorplan visualizations and barchart query results are currently defined explicitly. This could be improved by generating CSS classes dynamically based on the contents of the dataset.
Similarly, a centralized area for defining elasticsearch fields does not yet exist. Therefore customization in this regard will require some familiarity with the application structure.
The application is also being developed with mobile use in mind. We envision the application being used primarily on desktop and laptop devices, but continue to develop the application for tablet and other mobile devices in order to expand its usability.
Tools and frameworks:
- Angular (v1.5.7)
- Beautiful Soup (v3.2.1)
- Bootstrap (v3.3.2)
- d3.js (v3.5.17)
- FileSaver (v1.3.2)
- Flask (v0.11.1)
- Flask Login (v0.3.2)
- Flask Triangle (v0.5.4)
- Font Awesome (v4.6.3)
- jQuery (v1.11.1)
- jQuery Cookie (v1.4.1)
- jQuery Panzoom (v2.0.5)
- jQuery Tipsy (v1.0.0a)
- jQuery UI (v1.11.4)
- wsgicors (v0.6.0)
- wsgiref (v0.1.2)
How to Contribute
This application is currently in beta. Please report any bugs and issues here. If you're interested in contributing to development, please contact Kyle Hundman (firstname.lastname@example.org) prior to forking this repository.
Broad Areas of Improvement
- Making heavy use of Angular where it makes sense (because we didn't)
- Further improve mobile-friendliness
- Dynamic CSS classes (based on contents in data)
- Centralized area for customization (elasticsearch fields, data sources, etc.)
- Kyle Hundman: email@example.com
Special thanks to these JPLers:
- Thomas Berry
- Robert Bertsch
- Sue Fawcett
- Cameron Goodale
- Pete Jones
- Sonny Koliwad
- Andrea Ollier
- David Watkins
- Tom Soderstrom