File tree 1 file changed +0
-46
lines changed
1 file changed +0
-46
lines changed Original file line number Diff line number Diff line change 1
1
import init , { sudoku } from "../wasm-sudoku/pkg/wasm_sudoku.js" ;
2
2
3
- function draw ( tree_map ) {
4
-
5
- let nodes = Array ( tree_map [ tree_map . length - 1 ] . to )
6
- . fill ( null )
7
- . map ( ( _ , i ) => ( { id : i + 1 , label : `${ i + 1 } ` } ) ) ;
8
- let edges = tree_map ;
9
-
10
- // create a network
11
- let container = document . getElementById ( "mynetwork" ) ;
12
- let data = {
13
- nodes : new vis . DataSet ( nodes ) ,
14
- edges : new vis . DataSet ( edges ) ,
15
- } ;
16
- let options = {
17
- layout : {
18
- hierarchical : {
19
- direction : "UD" ,
20
- sortMethod : "hubsize" ,
21
- } ,
22
- } ,
23
- edges : {
24
- arrows : "to" ,
25
- } , physics : {
26
- enabled : false ,
27
- } , interaction : {
28
- tooltipDelay : 200 ,
29
- hideEdgesOnDrag : true ,
30
- dragNodes : false ,
31
- } ,
32
- configure : {
33
- filter : function ( option , path ) {
34
- if ( path . indexOf ( "hierarchical" ) !== - 1 ) {
35
- return true ;
36
- }
37
- return false ;
38
- } ,
39
- showButton : false ,
40
- } ,
41
- } ;
42
-
43
- network = new vis . Network ( container , data , options ) ;
44
-
45
- // periodically change the layout
46
-
47
- }
48
-
49
3
function draw_viz ( data ) {
50
4
let string_list = [ ] ;
51
5
for ( const i of data ) {
You can’t perform that action at this time.
0 commit comments