feature: cytoscape node positions are remembered

This commit is contained in:
Cindy Chang
2024-06-28 16:20:41 +08:00
parent b890df9de6
commit 2110388a2d
8 changed files with 134 additions and 19 deletions

View File

@@ -53,12 +53,14 @@
</template>
<script>
import { onBeforeMount, } from 'vue';
import { storeToRefs } from 'pinia';
import axios from 'axios';
import LoadingStore from '@/stores/loading.js';
import AllMapDataStore from '@/stores/allMapData.js';
import ConformanceStore from '@/stores/conformance.js';
import cytoscapeMap from '@/module/cytoscapeMap.js';
import CytoscapeStore from '@/stores/cytoscapeStore.js';
import SidebarView from '@/components/Discover/Map/SidebarView.vue';
import SidebarState from '@/components/Discover/Map/SidebarState.vue';
import SidebarTraces from '@/components/Discover/Map/SidebarTraces.vue';
@@ -69,9 +71,26 @@ export default {
const loadingStore = LoadingStore();
const allMapDataStore = AllMapDataStore();
const { isLoading } = storeToRefs(loadingStore);
const { processMap, bpmn, stats, insights, traceId, traces, baseTraces, baseTraceId, filterTasks, filterStartToEnd, filterEndToStart, filterTimeframe, filterTrace, temporaryData, isRuleData, ruleData, logId, baseLogId, createFilterId, cases, postRuleData } = storeToRefs(allMapDataStore);
const { processMap, bpmn, stats, insights, traceId, traces, baseTraces, baseTraceId,
filterTasks, filterStartToEnd, filterEndToStart, filterTimeframe, filterTrace,
temporaryData, isRuleData, ruleData, logId, baseLogId, createFilterId, cases,
postRuleData
} = storeToRefs(allMapDataStore);
return { isLoading, processMap, bpmn, stats, insights, traceId, traces, baseTraces, baseTraceId, filterTasks, filterStartToEnd, filterEndToStart, filterTimeframe, filterTrace, logId, baseLogId, createFilterId, temporaryData, isRuleData, ruleData, allMapDataStore, cases, postRuleData }
const cytoscapeStore = CytoscapeStore();
const { setCurrentGraphId } = cytoscapeStore;
onBeforeMount(() => {
setCurrentGraphId(logId);
});
return { isLoading, processMap, bpmn, stats, insights, traceId, traces, baseTraces,
baseTraceId, filterTasks, filterStartToEnd, filterEndToStart, filterTimeframe,
filterTrace, logId, baseLogId, createFilterId, temporaryData, isRuleData,
ruleData, allMapDataStore, cases, postRuleData,
setCurrentGraphId,
};
},
props:['type', 'checkType', 'checkId', 'checkFileId'], // router props
components: {
@@ -94,6 +113,7 @@ export default {
nodes: [],
edges: [],
},
cytoscapeGraph: null,
curveStyle:'unbundled-bezier', // unbundled-bezier | taxi
mapType: 'processMap', // processMap | bpmn
dataLayerType: 'freq', // freq | duration
@@ -355,7 +375,7 @@ export default {
if(this[type].vertices.length !== 0){
this.setNodesData(mapData);
this.setEdgesData(mapData);
cytoscapeMap(mapData, this.dataLayerType, this.dataLayerOption, this.curveStyle, this.rank, graphId);
this.cytoscapeGraph = cytoscapeMap(mapData, this.dataLayerType, this.dataLayerOption, this.curveStyle, this.rank, graphId);
};
},
},