Skip to content

Commit

Permalink
Merge pull request #36 from CUAHSI/develop
Browse files Browse the repository at this point in the history
Compact=False for geojson from HydroCron
  • Loading branch information
devincowan authored Jun 24, 2024
2 parents 20dccad + 32a417c commit aa1387b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion frontend/src/_helpers/hydroCron.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const queryHydroCron = async (swordFeature = null, output = 'geojson') => {
output: output,
fields: fields,
// https://podaac.github.io/hydrocron/timeseries.html#compact-string-required-no
compact: 'true'
compact: 'false'
}
let response = await fetchHydroCronData(HYDROCRON_URL, params, swordFeature)
if (response == null) {
Expand Down
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
19 changes: 15 additions & 4 deletions frontend/src/stores/hydrologic.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ export const useHydrologicStore = defineStore('hydrologic', () => {
unit: 'm^2',
definition:
'Total estimated water surface area, including area_detct and any dark water that was not detected as water in the SWOT observation but identified through the use of a prior water probability map.',
default: false,
default: true,
always: false,
selectable: false,
selectable: true,
fileType: 'all',
plottable: false,
plottable: true,
},
{
abbreviation: 'd_x_area',
Expand Down 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 aa1387b

Please sign in to comment.