Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Rfc2: Graph component

Meine Toonen edited this page May 8, 2014 · 4 revisions

Overview

A new component will be created for creating graphs.

Functional changes

The viewer-admin will get a new block in the layoutmanager for dragging the graph component to the layout. There it can be configured. The viewer will get a new button with which the graph component can be started. After a click on a feature which is configured with the graph component, a (interactive!) graph will be shown.

Technical changes

The changes needed for the completion of this functionality are described here.

Affected modules

The modules which are affected by these changes are split in the viewer and viewer-admin

Viewer

  1. A new component for showing the graph.
  2. A backend for retrieving the data for it's configured attribute sources
  3. Hooking the new component to the get feature info event

The creation of the graph is done by the JS/CSS framework ExtJS, which we already use, so this doesn't introduce any other dependencies. Other frameworks were considered (like D3, charts.js, highcharts). They were or too complex (the requested functionality is a "simple" graph), too bulky (large files, large configurations) or didn't meet our specs.

Viewer-admin

A new component with a configuration page. Just like any other component. You can configure multiple graphs in a application. Each graph consist of a layer which has a attributesource configured. Then you define one x-axis and multiple y-axis attributes, and a graph-type (line, horizontal bar, vertical bar). The y-axis can be either a direct attribute (example 1), or a linked attribute via relate (example 2):

Example 1

Layer with configured attributesource which has the following attributes: Name: x-axis Population 0 -14 yrs: y-axis Population 14 - 25 yrs: y-axis This can be used for a bar chart for the population (split by age) of each region

Example 2

Layer configured with an attributesource which has a linked attributesource: Attributesource 1 (region): Id Name

Attributesource 2 (population): fk (linked to attributesource 1 id) year population This can be used to configure a line chart which pops up when clicked on a region which displays a line chart of the population per year.

Backwards compatibility

We foresee no incompatibility with older version. All the old configurations will be kept and remain functional.

Reference to code

https://github.com/B3Partners/flamingo/tree/feat/rfc2_graph-component

Voting history

Clone this wiki locally