File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
views/graphPage/modals/open Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ export const importFile = asyncAction(async (file: NonNullable<GraphOrigin>) =>
6363 case "graphml" :
6464 graph = graphml . parse ( Graph , content , { addMissingNodes : true } ) ;
6565 break ;
66+ case "json" :
67+ graph = Graph . from ( JSON . parse ( content ) ) ;
68+ break ;
6669 default :
6770 graph = null ;
6871 break ;
Original file line number Diff line number Diff line change 305305 "title" : " Open a graph file" ,
306306 "local" : {
307307 "title" : " Open a local file" ,
308- "dragndrop_text" : " Drag'n'drop a GEXF or GRAPHML file" ,
308+ "dragndrop_text" : " Drag'n'drop a GEXF, GRAPHML or JSON file" ,
309309 "success" : " File {{filename}} has been successfully loaded" ,
310310 "error" : " An error occurred while opening the file. Please check that the file is a valid."
311311 },
312312 "remote" : {
313313 "title" : " Open an url" ,
314- "url-field" : " URL of a GEXF or GRAPHML file" ,
314+ "url-field" : " URL of a GEXF, GRAPHML or JSON file" ,
315315 "success" : " File {{filename}} has been successfully loaded" ,
316316 "error" : " An error occurred while opening the file. Please check your connectivity and that the file is a valid."
317317 },
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export const LocalFileModal: FC<ModalProps<unknown>> = ({ cancel }) => {
2727 value = { file }
2828 onChange = { ( file ) => setFile ( file ) }
2929 helpText = { t ( "graph.open.local.dragndrop_text" ) . toString ( ) }
30- accept = { { "application/graph" : [ ".gexf" , ".graphml" ] } }
30+ accept = { { "application/graph" : [ ".gexf" , ".graphml" ] , "application/json" : [ ".json" ] } }
3131 />
3232 { importStateType === "loading" && < Loader /> }
3333 </ >
You can’t perform that action at this time.
0 commit comments