# Modalflow: Cross-Origin Flow Data Visualization for Urban Mobility
## 4 Materials and Methods
### Scatterplot  
For a view over the abstract (non-spatial) distribution of data, we customized a scatterplot schema over flow magnitude and distance dimensions (R2). Every OD flow is represented as a clear circle of  
Figure 2: Ternary color scale construction schema (**a**) and resulting colormap (**b**) used to encode mode split across views.  
fixed or flow magnitude-weighted radius in the two-dimensional space. Selections can be made by dragging over the plot, thus selecting a distance-flow magnitude pair range, i.e., a rectangular area. Many different selections can be maintained at the same time, which can overlap or be embedded into each other. Statistics are calculated over a new selection (number of trips, flows, total distance, and portion of the whole) and annotated on the side.  
Selection ranges are also \"draggable\" while using right and left arrow keys. This interaction moves the selection range over the distance dimension, allowing to see the user to focus on another visualization and observe how distance correlates with the flow distribution on another view of the system.  
While testing the scatterplot, we discovered that normal range selection proved to be not effective for comparing different datasets, as range selections in one dataset would probably lead to an empty selection in the other one due to the very different distributions of data. Thus, to comply with R1, we developed a distribution-aware selection tool.  
As the distribution of the examined datasets proved to be different over this space, selections that were made over one dataset usually ended in an empty selection over the other one, making a the comparative approach ineffective. For this reason, we developed a distribution-aware selection tool that translates a selection over one distribution into a more alike selection over another distribution, as shown in Figure 3. It is a linear transformation of the XY space based on data distribution. This technique can be generalized to different datasets; however, a decision has to be made over the formal nature of their distribution to define the linear mapping. In this case, preliminary visualization experiments showed a power law-type distribution; thus, a measure of its powerlaw had to be taken into account (for a normal distribution, for example, its median and variance should determine the outcome mapping).  
In order to determine the mapping for the distribution-aware tool, the method is as follows: (1) for each dimension, sort the data according to that dimension and determine the threshold at which the highest ranking elements are equal in value to all the others; and, (2) this threshold is then the value of the scale factor \(k_{i}\) for dataset \(i\). The mapping of coordinate \(x_{j}\) from coordinate \(x_{i}\) is given by  
\[x_{j}=(x_{i}/k_{i})k_{j}.\]  
Figure 3: Selection over different datasets in the scatterplot is facilitated by our distribution-aware selection tool. A range selected in one scatterplot is not merely transposed to \(a\), which would probably end in an empty selection, but linearly transformed into \(b\), according to the grid automatically defined based on the distribution of each dataset.  
For the particular case of mobility flows, we deemed that using this technique only in the magnitude dimension was the most sensible choice, because using distribution-aware selection over distance would change the original meaning of a selection.