Skip to content

Commit

Permalink
visualization is now a package to avoid clashes with io.
Browse files Browse the repository at this point in the history
  • Loading branch information
phantomas1234 committed Feb 13, 2015
1 parent 01a8473 commit 47e7852
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
16 changes: 16 additions & 0 deletions cameo/visualization/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


from visualization import *
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__all__ = ['memoized', 'graph_to_svg', 'draw_knockout_result', 'inchi_to_svg']

import json
import logging
import subprocess
import tempfile
from functools import partial
from io import BytesIO

import networkx as nx
from escher import Builder

import os
Expand Down Expand Up @@ -175,9 +180,7 @@ def inchi_to_svg(inchi, file=None):

def graph_to_svg(g, layout=nx.spring_layout):
"""return the SVG of a matplotlib figure generated from a graph"""
import networkx as nx
import matplotlib.pyplot as plt
from io import BytesIO
layout = layout(g)
fig=plt.figure(figsize=(8, 8))
ax = fig.add_subplot(111)
Expand Down

0 comments on commit 47e7852

Please sign in to comment.