1
- import { APPEARANCE_ITEM_TYPES , AppearanceState , FilteredGraph , getEmptyAppearanceState } from "@gephi/gephi-lite-sdk" ;
1
+ import {
2
+ APPEARANCE_ITEM_TYPES ,
3
+ AppearanceState ,
4
+ FilteredGraph ,
5
+ FiltersState ,
6
+ getEmptyAppearanceState ,
7
+ } from "@gephi/gephi-lite-sdk" ;
2
8
import { MultiProducer , Producer , atom , derivedAtom , multiProducerToAction , producerToAction } from "@ouestware/atoms" ;
3
9
import EventEmitter from "events" ;
4
10
import { Attributes } from "graphology-types" ;
@@ -11,11 +17,12 @@ import { applyVisualProperties, getAllVisualGetters } from "../appearance/utils"
11
17
import { filtersAtom } from "../filters" ;
12
18
import { buildTopologicalFiltersDefinitions } from "../filters/topological" ;
13
19
import { FilterType } from "../filters/types" ;
14
- import { applyFilters } from "../filters/utils" ;
20
+ import { applyFilters , getEmptyFiltersState } from "../filters/utils" ;
15
21
import { itemsRemove , searchActions , searchAtom } from "../search" ;
16
22
import { SearchState } from "../search/types" ;
17
23
import { selectionAtom } from "../selection" ;
18
24
import { SelectionState } from "../selection/types" ;
25
+ import { getEmptySelectionState } from "../selection/utils" ;
19
26
import { ItemType } from "../types" ;
20
27
import { computeAllDynamicAttributes , dynamicAttributes } from "./dynamicAttributes" ;
21
28
import { DynamicItemData , FieldModel , GraphDataset , SigmaGraph } from "./types" ;
@@ -31,7 +38,7 @@ import {
31
38
32
39
/**
33
40
* Producers:
34
- * **********graphToExport
41
+ * **********
35
42
*/
36
43
const setGraphDataset : Producer < GraphDataset , [ GraphDataset ] > = ( dataset ) => {
37
44
return ( ) => dataset ;
@@ -172,8 +179,13 @@ const updateEdge: Producer<GraphDataset, [string, Attributes]> = (edge, attribut
172
179
} ;
173
180
} ;
174
181
175
- const resetGraph : Producer < GraphDataset , [ ] > = ( ) => {
176
- return ( ) => getEmptyGraphDataset ( ) ;
182
+ const resetGraph : MultiProducer < [ FiltersState , AppearanceState , SelectionState , GraphDataset ] , [ ] > = ( ) => {
183
+ return [
184
+ ( ) => getEmptyFiltersState ( ) ,
185
+ ( ) => getEmptyAppearanceState ( ) ,
186
+ ( ) => getEmptySelectionState ( ) ,
187
+ ( ) => getEmptyGraphDataset ( ) ,
188
+ ] ;
177
189
} ;
178
190
179
191
/**
@@ -253,7 +265,7 @@ export const graphDatasetActions = {
253
265
updateEdge : producerToAction ( updateEdge , graphDatasetAtom ) ,
254
266
deleteItemsAttribute : producerToAction ( deleteItemsAttribute , graphDatasetAtom ) ,
255
267
deleteItems : multiProducerToAction ( deleteItems , [ searchAtom , selectionAtom , graphDatasetAtom ] ) ,
256
- resetGraph : producerToAction ( resetGraph , graphDatasetAtom ) ,
268
+ resetGraph : multiProducerToAction ( resetGraph , [ filtersAtom , appearanceAtom , selectionAtom , graphDatasetAtom ] ) ,
257
269
} ;
258
270
259
271
/**
0 commit comments