home

SWire Web Apps Collection documentation


Introduction

The SWire Web App Collection (SWAC) is a collection of demo web applications which explain how to use SWire and SWire4js in developing SWire web applications, namely, software which runs on web browsers and interacts with Stata. SWAC is an open source project and you can download the code from the project web site web site or try the apps on-line here.

The SWire Web App Collection consists of the following apps:


Requirements

The applications from the SWire Web Apps Collection (SWAC) require that SWire has been installed onto Stata and that the SWire server is running. SWire requires Stata >= 13.

Communication between the SWAC and Swire applications will not be possible if:

  • the network port used by SWAC is not the same as that used by SWire (the default value is 50000)
  • there is a firewall blocking the network traffic on that port.

Settings

The SWAC settings can be modified by adjusting the settings.js file, which is located in the js folder. Currently the only parameter which can be set is the network port, which is used for communicating with SWire (the default value is 50000). This parameter value is stored in the g_swirePort JavaScript variable, which is defined in settings.js.

The app's web page must be refreshed so that the new settings can take effect. It is possible that a cache clear is also needed in your browser.


CoordPicker

Introduction

CoordPicker is a SWire web app which is useful for inputting data relating to geographical data. It provides a Google map with a marker which can be dragged onto that map. When the user right-clicks on the marker, a data row with latitude, longitude and the corresponding address will be appended to the Stata dataset.

Instructions

  1. Be sure that Stata is open and SWire is running.
  2. Click on the Init Stata dataset button in order to create a Stata dataset where coordinates and addresses can be stored.
  3. Drag the marker onto the map and release it at the desired location.
  4. Right click on the marker to save the coordinates and address in Stata.

TV Shows Survey

Introduction

TV Shows Survey is a SWire web app which demonstrates how to create a complex form for inputting data to Stata. The TV Shows Survey provides the user with a form for entering data which can be collected from a hypothetical survey of preferred TV shows. The form offers:

  • a text-input for the respondent's name
  • a combobox for the respondent's gender
  • a calendar for the respondent's birthday
  • a set of sortable items for representing the ranking of the respondent's preferred TV shows.

Instructions

  1. Be sure that Stata is open and SWire is running.
  2. Click on the Init Stata dataset button in order to create a Stata dataset where form data can be stored.
  3. Complete the form.
  4. Click on the Add record button to add a new record to the Stata dataset.

Automatic Report

Introduction

Automatic Report is a SWire web app which demonstrates how to develop an automatic report, namely, a statistical report with data which is automatically retrieved from Stata.

Instructions

  1. Be sure that Stata is open and SWire is running.
  2. Copy the code which is into the text-box and paste it into Stata: this code will generate the Stata scalars necessary for generating the automatic report.
  3. Click on the link in the web page to generate the automatic report: the data will be retrieved from Stata.

Also see

SWire
A software interface, enabling us to query Stata for the executing of basic operations, such as reading or writing data

2016 Italian Stata Users Group Meeting, Rome 17-18 November
Abstract and slides presented at the Italian Stata Users Group Meeting 2016

SWire4js
A JavaScript library for developing SWire web applications

SWire4R
An R package enabling R to interact with Stata for exchanging data

Swire4QGIS
A QGIS plugin enabling data exchange with Stata

SQuery
A web application for collecting questionnaires' responses in Stata


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.