Пример #1
0
#!/usr/bin/env /usr/bin/python
# -*- coding: utf-8 -*-

import render
import get_svg
import util


args = util.get_args()
render.http_header()
gt = args['GraphTerm'] if 'GraphTerm' in args else ''
mode = args['GraphMode'] if 'GraphMode' in args else ''

print get_svg.get_svg(args)
print get_svg.get_svg_all(args)
Пример #2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import util
from json import dumps
from render import http_header
from query import get_cooccurrences

http_header()
args = util.get_args()
if 'term' in args:
    print dumps([{
        'value': st,
        'co': co
    } for (st, co) in get_cooccurrences(args['term'])])
else:
    print dumps([])
Пример #3
0
#!/usr/bin/env /usr/bin/python
# -*- coding: utf-8 -*-
import render
import query
import util
import get_svg
import re

args = util.get_args() #get the form data in an array

render.http_header() #load header
render.html_header() #load scripts
gt = args['GraphTerm'] if 'GraphTerm' in args else ''
#ct = args['ClusterTerm'] if 'ClusterTerm' in args else ''
mode = args['GraphMode'] if 'GraphMode' in args else ''
render.render_div_search(ft=gt, gt=gt) #display form
#render.render_datalist( 'terms');

x = args['all'] if 'all' in args else ''

match = re.search(r'cl[0-9]',mode)

if mode == 'all' or match:
    print '''
        <p> Most Connected graph </p>
        '''
    print get_svg.get_svg_all(args)
    print '''
            </div>
            '''
Пример #4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import util
from json import dumps
from render import http_header
from query import get_cooccurrences

http_header()
args = util.get_args()
if 'term' in args:
    print dumps([{'value': st, 'co' : co} for (st, co) in get_cooccurrences(args['term'])])
else:
    print dumps([])
Пример #5
0
# -*- coding: utf-8 -*-

# when more than one python exist in system, libraries might not be properly linked

import render
import util
import query
from random import choice
import string
from igraph.datatypes import UniqueIdGenerator
import igraph
import numpy as np


args = util.get_args()
render.http_header()
render.html_header()

max_vertices = 70
gt = args['GraphTerm'] if 'GraphTerm' in args else ''
#ct = args['ClusterTerm'] if 'ClusterTerm' in args else ''
mode = args['GraphMode'] if 'GraphMode' in args else ''
render.render_div_search(ft=gt, gt=gt) #display form
#render.render_datalist( 'terms');


if 'GraphTerm' in args and 'GraphMode' in args:
    graph_path = '/tmp/{}.svg'.format(''.join(choice(string.ascii_uppercase + string.digits) for _ in xrange(10)))
    render.render_div_search(gt=args['GraphTerm'], ft=args['GraphTerm'])
    render.render_datalist()
    if args['GraphMode'] == 'simple':
Пример #6
0
#!/usr/bin/env /usr/bin/python
# -*- coding: utf-8 -*-
import render
import query
import util
import get_svg
import re

args = util.get_args()  #get the form data in an array

render.http_header()  #load header
render.html_header()  #load scripts
gt = args['GraphTerm'] if 'GraphTerm' in args else ''
#ct = args['ClusterTerm'] if 'ClusterTerm' in args else ''
mode = args['GraphMode'] if 'GraphMode' in args else ''
render.render_div_search(ft=gt, gt=gt)  #display form
#render.render_datalist( 'terms');

x = args['all'] if 'all' in args else ''

match = re.search(r'cl[0-9]', mode)

if mode == 'all' or match:
    print '''
        <p> Most Connected graph </p>
        '''
    print get_svg.get_svg_all(args)
    print '''
            </div>
            '''