feature: cytoscape node positions are remembered
This commit is contained in:
@@ -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);
|
||||
};
|
||||
},
|
||||
},
|
||||
Reference in New Issue
Block a user