yiboyang / graphrel

Intuitive graph theory explorer powered by d3
http://yiboyang.github.io/graphrel
20 stars 4 forks source link

Cut-and-paste into the adjacency list #2

Open erelsgl opened 8 years ago

erelsgl commented 8 years ago

I started with an empty graph with 4 nodes:

0:[],1:[],2:[],3:[]

Then, I replaced the contents of the adjacency list text-box with

0:[1],1:[2],2:[3],3:[0]

But, nothing happened to the graph - it remained edge-less.

Probably there is some problem with pasting text into the adjacency list text-box.

erelsgl commented 8 years ago

I found a potential source of the problem: when I pasted the text, there were leading spaces (the text I pasted was: " 0:[1],1:[2],2:[3],3:[0]"). Is there a problem with leading whitespace in the textbox?

yiboyang commented 8 years ago

Yep, reproduced; problem was leading/trailing whitespace; this also occurs for uploading adjacency list. Idk why I trimmed whitespace after the regex test.

yiboyang commented 8 years ago

Latest commit should have fixed this; unfortunately you still have to manually remove whitespace between each parentNode:[childNodes], pair (e.g. 0:[1],1:[0] instead of 0:[1], 1:[0]) for now