Skip to content
Daniel L. Young, Ph.D edited this page May 27, 2020 · 3 revisions

Using the USEEIO Widgets

Communication between widgets

The communication between the widgets is done via configuration objects and a set of methods that all widgets implement. There are widgets that display data based on a configuration (like the ImpactChart widget). Calling the update method with a configuration will update the widget:

widget.update(config);

Other widgets create new configurations (like the SectorList widget). With the onChanged method it is possible to react on these configuration changes:

widget.onChanged((config) => {
  // do something with the updated config
});

With these methods the widgets can be linked in the following way:

sectorList.onChanged((config) => {
  impactChart.update(config);
});

There can be different widgets that produce and consume configurations on a page. These widgets can join a transmitter that collects configuration changes and calls the respective update methods of these widgets:

configTransmitter.join(widget);

For example, the HashConfigTransmitter uses the anchor part of the URL to de-/serialize the configuration:

const hashTransmitter = new useeio.HashConfigTransmitter();
hashTransmitter.join(sectorList);
hashTransmitter.join(impactChart);

Widget Documentation

   Impact chart

Clone this wiki locally