TOCView
- Collection of Categories
TOCCategoryItem
- Represents a Category (collection of stations)
TOCStationItem
- Represents a single station
onItemSelect (model):
-
Change station color
-
Draw Popup
-
toggle class "selected" for the TOCItem where model is the model parameter
-
TOCView -> Listens for station collection reset
-
TOCItem -> listens for station model change
-
MapView -> listens for station collection reset
app.collections.stations = new StationCollection(); // this maintains a list of all stations (no matter what) should be immutable
app.collections.activeStations = new StationCollection(); // this maintains a filtered list of stations depending on selections
// Dispatcher
this.listenTo(this.collecitons.activeStations, "reset", funciton(collection) {
self.views.mapView.redrawStations(); --> Cause the map to get
self.views.tocView.render();
});
this.listenTo(this, "onStationSelect", function(model) {
self.views.tocView.selectItem(model); // toggles the class for its items where the model is equivalent
self.views.mapView.selectStation(model); // Changes color for the station selected
});
this.listenTo(this, "onCategorySelect", function(model) {
var models = self.collections.stations.where(category.id == model.category_id);
self.collections.activeStations.reset(models);
});
this.listenTo(this.collections.stations, "reset", function(collection) {
self.collections.activeStations.reset(collection.models);
});
this.colletions.stations.fetch({reset:true});
- /plots/?station_id=tollsps
- /plots/ -> select the first available station and variable
PlotTOCView
- station collection
PlotTOCStationItem
- Represents a single station
PlotTOCVariableItem
- Represnts a variable of an item
SVGView (from OOI)
- accepts a URL to get the SVG Plot
- Accepts some dimensions (div width/height)
DataTableView
Events:
-
onVariableAdd (click the add button)
svgview.clear() // doesn't exist yet svgview.fetch({url: $.param({variables: [vars] + newVar})});
-
onStationSelect
-
onRemoveVariable (click minus or remove button on the legend)
TOCView (same as map)
StationMetadatView
- Visualization of the station's metadata
MapView
- collection of just the one station
this.views.tocView = new TOCView({
collections: this.collections.activeStations;
categories: this.collections.categories;
});
this.listenTo(this.collections.stations, "reset", function(collection) {
self.collections.activeStations.reset(collection.models);
});
this.colletions.stations.fetch({reset:true});