Skip to content

Commit

Permalink
embed aggregate-od in dashboard correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
billyc committed Mar 29, 2022
1 parent 31a698e commit abb760e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/charts/allCharts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import map from './map-polygons.vue'
// ----- EXPORT CHARTS HERE ---------------------------------------------------
// export all resizable charts here
export const plotlyCharts = {
aggregate,
area,
bar,
bubble,
Expand All @@ -45,7 +46,7 @@ export const plotlyCharts = {
}

// export all remaining charts/maps here:
export default Object.assign({ aggregate, carriers, flowmap, links, map }, plotlyCharts)
export default Object.assign({ carriers, flowmap, links, map }, plotlyCharts)

// ----- HELPER FUNCTIONS -----------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion src/components/RunFinderPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
.bottom-panel
//- h3 Search
//- input.input(placeholder="Search text (TBA)")
button.button.clear-button.is-warning(v-if="state.statusErrors.length && showWarnings || state.statusWarnings.length && showWarnings" @click="clearAllButtons()") Clear all errors
button.button.clear-button.is-warning(v-if="state.statusErrors.length && showWarnings || state.statusWarnings.length && showWarnings" @click="clearAllButtons()") Clear all messages


.commands
Expand Down
18 changes: 15 additions & 3 deletions src/plugins/aggregate-od/AggregateOd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ import TimeSlider from './TimeSlider.vue'
import ScaleSlider from '@/components/ScaleSlider.vue'
import ZoomButtons from '@/components/ZoomButtons.vue'
import { ColorScheme, FileSystem, FileSystemConfig, VisualizationPlugin } from '@/Globals'
import { ColorScheme, FileSystem, FileSystemConfig, Status, VisualizationPlugin } from '@/Globals'
import HTTPFileSystem from '@/js/HTTPFileSystem'
import globalStore from '@/store'
Expand Down Expand Up @@ -406,8 +406,13 @@ class MyComponent extends Vue {
return { shpFile, dbfFile, odFlows }
//
} catch (e) {
console.error({ e })
const error = e as any
let msg = error.statusText || '' + error
if (error.url) msg += ': ' + error.url
console.error(msg)
this.loadingText = '' + e
this.$store.commit('error', msg)
return null
}
}
Expand Down Expand Up @@ -924,7 +929,7 @@ class MyComponent extends Vue {
const options = this.thumbnail
? { animate: false }
: {
padding: { top: 100, bottom: 100, right: 100, left: 100 },
padding: { top: 25, bottom: 25, right: 100, left: 100 },
animate: false,
}
this.mymap.fitBounds(this._mapExtentXYXY, options)
Expand Down Expand Up @@ -1075,6 +1080,13 @@ class MyComponent extends Vue {
this.colName = headers[1]
this.headers = [TOTAL_MSG].concat(headers.slice(2))
if (!this.rowName || !this.colName) {
this.$store.commit('setStatus', {
type: Status.WARNING,
msg: 'CSV data might be wrong format',
desc: 'First column has no name. Data MUST be orig,dest,values...',
})
}
// console.log(this.headers)
await forEachAsync(lines.slice(1), (row: any) => {
Expand Down

0 comments on commit abb760e

Please sign in to comment.