def create(iterations=<NUM_LIT:1000>, distance=<NUM_LIT:1.0>, layout=LAYOUT_SPRING, depth=True):
<EOL>_ctx.colormode(_ctx.RGB)<EOL>g = graph(iterations, distance, layout)<EOL>s = style.style<EOL>g.styles.append(s(style.LIGHT    , _ctx, fill   = _ctx.color(<NUM_LIT:0.0>, <NUM_LIT:0.0>, <NUM_LIT:0.0>, <NUM_LIT>)))<EOL>g.styles.append(s(style.DARK     , _ctx, fill   = _ctx.color(<NUM_LIT>, <NUM_LIT:0.5>, <NUM_LIT>, <NUM_LIT>)))<EOL>g.styles.append(s(style.BACK     , _ctx, fill   = _ctx.color(<NUM_LIT:0.5>, <NUM_LIT>, <NUM_LIT:0.0>, <NUM_LIT>)))<EOL>g.styles.append(s(style.IMPORTANT, _ctx, fill   = _ctx.color(<NUM_LIT>, <NUM_LIT>, <NUM_LIT>, <NUM_LIT>)))<EOL>g.styles.append(s(style.HIGHLIGHT, _ctx, stroke = _ctx.color(<NUM_LIT:1.0>, <NUM_LIT:0.0>, <NUM_LIT:0.5>), strokewidth=<NUM_LIT>))<EOL>g.styles.append(s(style.MARKED   , _ctx))<EOL>g.styles.append(s(style.ROOT     , _ctx, text   = _ctx.color(<NUM_LIT:1.0>, <NUM_LIT:0.0>, <NUM_LIT>, <NUM_LIT>), <EOL>stroke = _ctx.color(<NUM_LIT>, <NUM_LIT>, <NUM_LIT>, <NUM_LIT>),<EOL>strokewidth = <NUM_LIT>, <EOL>fontsize    = <NUM_LIT:16>, <EOL>textwidth   = <NUM_LIT>))<EOL>def important_node(s, node, alpha=<NUM_LIT:1.0>):<EOL><INDENT>style.style(None, _ctx).node(s, node, alpha)<EOL>r = node.r * <NUM_LIT><EOL>_ctx.nofill()<EOL>_ctx.oval(node.x-r, node.y-r, r*<NUM_LIT:2>, r*<NUM_LIT:2>)  <EOL><DEDENT>def marked_node(s, node, alpha=<NUM_LIT:1.0>):<EOL><INDENT>style.style(None, _ctx).node(s, node, alpha)<EOL>r = node.r * <NUM_LIT><EOL>_ctx.fill(s.stroke)<EOL>_ctx.oval(node.x-r, node.y-r, r*<NUM_LIT:2>, r*<NUM_LIT:2>)<EOL><DEDENT>g.styles.important.node = important_node<EOL>g.styles.marked.node = marked_node <EOL>g.styles.depth = depth<EOL>g.styles.guide.append(style.LIGHT     , lambda graph, node: graph.root in node.links)<EOL>g.styles.guide.append(style.DARK      , lambda graph, node: len(node.links) > <NUM_LIT:4>)<EOL>g.styles.guide.append(style.IMPORTANT , lambda graph, node: node.weight > <NUM_LIT>)<EOL>g.styles.guide.append(style.ROOT      , lambda graph, node: node == graph.root)<EOL>g.styles.guide.append(style.BACK      , lambda graph, node: node == graph.events.clicked)<EOL>def balance(graph, node): <EOL><INDENT>node.r = node.r*<NUM_LIT> + node.r*node.weight*<NUM_LIT><EOL><DEDENT>g.styles.guide.append("<STR_LIT>", balance)<EOL>def cluster(graph, node):<EOL><INDENT>if len(node.links) == <NUM_LIT:1>: <EOL><INDENT>node.links.edge(node.links[<NUM_LIT:0>]).length *= <NUM_LIT:0.5><EOL><DEDENT><DEDENT>g.styles.guide.append("<STR_LIT>", cluster)<EOL>g.styles.guide.order = [<EOL>style.LIGHT, style.DARK, style.IMPORTANT, style.ROOT, style.BACK, "<STR_LIT>", "<STR_LIT>"<EOL>]<EOL>return g<EOL>
Returns a new graph with predefined styling.