visualizing data structures with svg
so i found dropping SVG to disk is an easy and fun way to visualize or debug data structures. here’s all it takes in C: FILE * fp = fopen(“kdtree.svg”, “w”); fprintf(fp, “<svg version=\”1.1\” width=\”1024\” height=\”1024\” xmlns=\”http://www.w3.org/2000/svg\”>\n”); fprintf(fp, “<line stroke=\”#%06x\” stroke-width=\”.1\” x1=\”%f\” y1=\”%f\” x2=\”%f\” y2=\”%f\”/>\n”, …); fprintf(fp, “</svg>”); what’s nice is then you can load [...]