This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
function parseImagesFromCSS(doc) { | |
var i, j, | |
rule, | |
image, | |
pattern = /url\((.*)\)/, | |
properties = ['background-image', '-webkit-border-image'], | |
images = {}; | |
if (doc.styleSheets) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pydot | |
open('twopi2.gv.txt').read() | |
'digraph G {\n ranksep=3;\n ratio=auto;\n"1" [ label="01",shape="hexagon",style="filled",color="green" ];\n"2" [ label="02",shape="hexagon",style="filled",color="green" ];\n"3" [ label="02",shape="hexagon",style="filled",color="green" ];\n"1" -> "2" [ label=" ",color="blue",arrowhead="dot" ];\n"1" -> "3" [label="",color="blue",arrowhead=" | |
dot" ];\n}\n' | |
graph = pydot.graph_from_dot_data(open('twopi2.gv.txt').read()) | |
svg = graph.create_svg() | |
svg | |
# OUT: '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"\n "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [\n <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink">\n]>\n<!-- Generated by Graphviz version 2.20.2 (Tue Mar  2 19:03:41 UTC 2010)\n For user: (rmyeid) Rami Al-rfou' -->\n<!-- Title: G Pages: 1 -->\n<svg width="134pt" height="314pt"\n viewBox="0.00 0.00 134.00 314.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http: |