Skip to content

Commit bfbce80

Browse files
committed
adding basckground for multiple graphs
1 parent c115d31 commit bfbce80

File tree

10 files changed

+484
-5
lines changed

10 files changed

+484
-5
lines changed

client/src/MapStore.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,26 @@ export default class MapStore {
178178

179179
public static mapLayerFeatureGraphsVisible = ref(false);
180180

181+
public static vectorFeatureTableGraphVisible = ref(false);
182+
183+
public static vectorFeatureTableData: Ref<{ layerId: number, vectorFeatureId: number } | null> = ref(null);
184+
185+
public static setVectorFeatureTableData = (layerId: number, vectorFeatureId: number) => {
186+
if (MapStore.mapLayerFeatureGraphsVisible.value) {
187+
MapStore.mapLayerFeatureGraphsVisible.value = false;
188+
}
189+
MapStore.vectorFeatureTableData.value = {
190+
layerId,
191+
vectorFeatureId,
192+
};
193+
MapStore.vectorFeatureTableGraphVisible.value = true;
194+
};
195+
196+
public static clearVectorFeatureTableData = () => {
197+
MapStore.vectorFeatureTableData.value = null;
198+
MapStore.vectorFeatureTableGraphVisible.value = false;
199+
};
200+
181201
// Graph color mapping implementation
182202
public static enabledMapLayerFeatureColorMapping = ref(false);
183203

client/src/api/UVDATApi.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
DerivedRegion,
1212
DisplayConfiguration,
1313
FeatureGraphData,
14+
FeatureGraphs,
15+
FeatureGraphsRequest,
1416
FileItem,
1517
LayerCollection,
1618
LayerCollectionLayer,
@@ -538,6 +540,44 @@ export default class UVdatApi {
538540
return response.data;
539541
}
540542

543+
public static async getFeatureGraphsData(
544+
payload: FeatureGraphsRequest,
545+
): Promise<FeatureGraphs[]> {
546+
const {
547+
tableTypes,
548+
vectorFeatureId,
549+
xAxes = ['index'],
550+
yAxes = ['mean_va'],
551+
indexers = [],
552+
display = ['data', 'trendLine'],
553+
confidenceLevel = 95,
554+
aggregate = false,
555+
movingAverage,
556+
} = payload;
557+
558+
const params = new URLSearchParams();
559+
560+
tableTypes.forEach((type) => params.append('tableType', type));
561+
xAxes.forEach((x) => params.append('xAxis', x));
562+
yAxes.forEach((y) => params.append('yAxis', y));
563+
indexers.forEach((indexer) => params.append('indexer', indexer));
564+
display.forEach((d) => params.append('display', d));
565+
566+
params.append('vectorFeatureId', vectorFeatureId.toString());
567+
params.append('confidenceLevel', confidenceLevel.toString());
568+
params.append('aggregate', aggregate.toString());
569+
if (movingAverage !== undefined) {
570+
params.append('movingAverage', movingAverage.toString());
571+
}
572+
573+
const response = await UVdatApi.apiClient.get<FeatureGraphs[]>(
574+
'/vectorfeature/tabledata/feature-graphs/',
575+
{ params },
576+
);
577+
578+
return response.data;
579+
}
580+
541581
public static async getMapLayerFeatureGraphData(
542582
tableType: string,
543583
mapLayerId: number,

client/src/components/FeatureSelection/VectorFeatureChart.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { throttle } from 'lodash';
66
import UVdatApi from '../../api/UVDATApi';
77
import { FeatureGraphData, VectorFeatureTableGraph } from '../../types';
88
import { renderVectorFeatureGraph } from './vectorFeatureGraphUtils';
9+
import MapStore from '../../MapStore';
910
1011
export default defineComponent({
1112
name: 'FeatureGraph',
@@ -156,6 +157,10 @@ export default defineComponent({
156157
movingAverageValue,
157158
], throttledUpateDialogGraph);
158159
160+
const openBottomGraph = () => {
161+
MapStore.setVectorFeatureTableData(props.mapLayerId, props.vectorFeatureId);
162+
};
163+
159164
return {
160165
graphContainer,
161166
graphDialogContainer,
@@ -170,6 +175,7 @@ export default defineComponent({
170175
movingAverageEnabled,
171176
movingAverageValue,
172177
maxMovingAverage,
178+
openBottomGraph,
173179
};
174180
},
175181
});
@@ -186,6 +192,9 @@ export default defineComponent({
186192
<v-btn color="primary" size="x-small" @click="openDialog">
187193
View Larger Graph
188194
</v-btn>
195+
<v-btn color="primary" size="x-small" @click="openBottomGraph">
196+
Bottom Graph
197+
</v-btn>
189198
</div>
190199
<svg ref="graphContainer" width="100%" :height="graphData ? 400 : 0" class="selectedFeatureSVG" />
191200
<v-dialog v-model="dialogVisible" max-width="1200px">

0 commit comments

Comments
 (0)