Skip to content

Commit

Permalink
use p_dist_out
Browse files Browse the repository at this point in the history
  • Loading branch information
devincowan committed Jun 6, 2024
1 parent e30ea71 commit b2625cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
8 changes: 3 additions & 5 deletions frontend/src/stores/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const useChartsStore = defineStore('charts', () => {

const getNodeLabels = (nodes) => {
const labels = nodes.map((node) => {
// TODO:nodes this will only grab the first node dist value -- there is variation among the hits
return node.queries[0].results.geojson.features[0].properties.node_dist
// TODO:nodes this will only grab the first p_dist_out value -- there is variation among the hits
return node.queries[0].results.geojson.features[0].properties.p_dist_out
})
return labels.filter((l) => l != undefined)
}
Expand Down Expand Up @@ -153,8 +153,6 @@ export const useChartsStore = defineStore('charts', () => {
const getNodeChartDatasets = (nodes) => {
const featureStore = useFeaturesStore()
console.log('getting node chart datasets for nodes', nodes)
// TODO:nodes I was expecting that the node_dist would be constant across timestamps but it isn't
// https://www.chartjs.org/docs/latest/general/data-structures.html#parsing
let measurements = nodes.map((node) => {
console.log('Parsing node', node)
return node.queries[0].results.geojson.features.map((feature) => {
Expand All @@ -169,7 +167,7 @@ export const useChartsStore = defineStore('charts', () => {
label: `${featureStore.getFeatureName(nodes[0])} | ${nodes[0]?.properties?.reach_id}`,
data: measurements,
parsing: {
xAxisKey: 'node_dist',
xAxisKey: 'p_dist_out',
yAxisKey: 'wse'
},
...getDataSetStyle(measurements)
Expand Down
13 changes: 12 additions & 1 deletion frontend/src/stores/hydrologic.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,21 @@ export const useHydrologicStore = defineStore('hydrologic', () => {
},
{
abbreviation: 'node_dist',
name: 'Node Distance',
name: 'Node Delta',
unit: 'm',
definition: 'Mean distance between observed and prior river database node locations.',
default: false,
always: false,
selectable: false,
fileType: 'node',
plottable: true,
},
{
abbreviation: 'p_dist_out',
name: 'Distance to Outlet',
unit: 'm',
definition: 'Along-stream distance from the reach center to the outlet, from the PRD.',
default: false,
always: true,
selectable: false,
fileType: 'node',
Expand Down

0 comments on commit b2625cf

Please sign in to comment.