def main(self): main.main()
# -*- coding: utf-8 -*- """ Created on Wed Feb 26 15:18:05 2020 @author: Jean """ # Prepare datasets in Orane Table format with Spyder. from Orange.data import Table table1 = Table("iris") # set name to be displayed in Glueviz table1.name = "iris" table2 = Table("titanic") # set name to be displayed in Glueviz table2.name = "titanic" # Call Orange and pass in the prepared data sets import sys from Orange.canvas import __main__ as OrangeMain sys.exit(OrangeMain.main(datasets=[table1, table2])) # Do some data mining works with Orange. # Call Glueviz to explore data sets with the "Glueviz Explorer" widget in Orange.
def main(self): from Orange.canvas.__main__ import main main()
import sys import os import Orange.canvas.__main__ as orange from Orange import widgets import logging import Orange.canvas.registry.discovery as discovery import nltk.data def dummy_widget_discovery(discovery): pass if __name__ == "__main__": logging.basicConfig(stream=sys.stdout, level=logging.ERROR) setattr(widgets, 'widget_discovery', dummy_widget_discovery) import os # os.remove("/Users/Chao/Library/Caches/Orange/3.4.5/canvas/widget-registry.pck") sys.exit(orange.main())
# set color for different edges between different vertices vs = g.vs.select(type_eq="software") es = g.es.select(_target_in=vs) es["color"] = "red" vs2 = g.vs.select(label_in=["Spyder", "Glueviz"]) ids = vs["id"] ids2 = vs2["id"] ids3 = list(set(ids) - set(ids2)) es = g.es.select(_within=ids3) es["color"] = "orange" vs = g.vs.select(type_eq="data") es = g.es.select(_target_in=vs) es["color"] = "blue" es = g.es.select(_within=vs) es["color"] = "darkgreen" # set edges label and width with weight g.es["width"] = g.es["weight"] g.es["label"] = g.es["weight"] # set layout of the graph layout = g.layout("kk") # set random to same to get the same graph next time random.seed(20) plot(g, bbox=(500, 300), layoyt=layout) # plot(g,"python_suits.SVG",layoyt = layout) # test orange network with directed network vstb, estb = graph2tables(g, name="Python") import sys import Orange from Orange.canvas import __main__ as OrangeMain sys.exit(OrangeMain.main(datasets=[vstb, estb]))