rewrite 2dnmr module with jsGraph