def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.data = None # self.apply is changed later, pylint: disable=unnecessary-lambda box = gui.radioButtons( self.controlArea, self, "feature_type", box="特征名称", callback=self.commit.deferred) button = gui.appendRadioButton(box, "通用") edit = gui.lineEdit( gui.indentedBox(box, gui.checkButtonOffsetHint(button)), self, "feature_name", placeholderText="键入前缀 ...", toolTip="自定义特征名称") edit.editingFinished.connect(self._apply_editing) self.meta_button = gui.appendRadioButton(box, "从变量:") self.feature_model = DomainModel( valid_types=(ContinuousVariable, StringVariable), alphabetical=False) self.feature_combo = gui.comboBox( gui.indentedBox(box, gui.checkButtonOffsetHint(button)), self, "feature_names_column", contentsLength=12, searchable=True, callback=self._feature_combo_changed, model=self.feature_model) self.remove_check = gui.checkBox( gui.indentedBox(box, gui.checkButtonOffsetHint(button)), self, "remove_redundant_inst", "删除冗余实例", callback=self.commit.deferred) gui.auto_apply(self.buttonsArea, self) self.set_controls()
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) # self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.vc = cv.VideoCapture(0) self.vc.set(3, 640) # set width self.vc.set(4, 480) # set height self.image_label = QLabel() # self.image_label.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored) self.controlArea.layout().addWidget(self.image_label) # self.resize(pixmap.width(), pixmap.height()) # # self.frame_timer = QTimer() # self.frame_timer.timeout.connect(self.update_frame) # self.frame_timer.start(0) # # self.output_timer = QTimer() # self.output_timer.timeout.connect(self.commit) # self.output_timer.start(0) # self.current_frame = None self.start(self.worker) self.setBlocking(False)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.data = None gui.radioButtons(self.controlArea, self, "axis", ["Rows", "Columns"], box="Distances between", callback=self._invalidate) box = gui.widgetBox(self.controlArea, "Distance Metric") self.metrics_combo = gui.comboBox(box, self, "metric_idx", items=[m[0] for m in METRICS], callback=self._metric_changed) self.normalization_check = gui.checkBox( box, self, "normalized_dist", "Normalized", callback=self._invalidate, tooltip=("All dimensions are (implicitly) scaled to a common" "scale to normalize the influence across the domain."), stateWhenDisabled=False) _, metric = METRICS[self.metric_idx] self.normalization_check.setEnabled(metric.supports_normalization) gui.auto_apply(self.controlArea, self, "autocommit")
def __init__(self): OWWidget.__init__(self) self.data = None # type: Table self.disc_data = None # type: Table # GUI box = gui.vBox(self.controlArea) self.feature_model = DomainModel( order=DomainModel.ATTRIBUTES, separators=False, placeholder="(All combinations)") gui.comboBox( box, self, "feature", callback=self._feature_combo_changed, model=self.feature_model ) self.vizrank, _ = InteractionRank.add_vizrank( None, self, None, self._vizrank_selection_changed) self.vizrank.button.setEnabled(False) self.vizrank.threadStopped.connect(self._vizrank_stopped) gui.separator(box) box.layout().addWidget(self.vizrank.filter) box.layout().addWidget(self.vizrank.rank_table) button_box = gui.hBox(self.buttonsArea) button_box.layout().addWidget(self.vizrank.button)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.corpus = None self.last_config = None # to avoid reruns with the same params self.strings_attrs = [] self.profiler = TweetProfiler(on_server_down=self.Error.server_down) # Settings self.controlArea.layout().addWidget(self.generate_grid_layout()) # Auto commit buttons_layout = QHBoxLayout() buttons_layout.addSpacing(15) buttons_layout.addWidget( gui.auto_commit(None, self, 'auto_commit', 'Commit', box=False) ) self.controlArea.layout().addLayout(buttons_layout) self.cancel_button = QPushButton( 'Cancel', icon=self.style() .standardIcon(QStyle.SP_DialogCancelButton)) self.cancel_button.clicked.connect(self.cancel) hbox = gui.hBox(self.controlArea) hbox.layout().addWidget(self.cancel_button) self.cancel_button.setDisabled(True)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.data = None gui.radioButtons(self.controlArea, self, "axis", ["行", "列"], box="之间的距离", callback=self._invalidate) box = gui.widgetBox(self.controlArea, "距离度量") self.metrics_combo = gui.comboBox( box, self, "metric_idx", items=[m[0] for m in Chinese_METRICS], callback=self._metric_changed) self.normalization_check = gui.checkBox( box, self, "normalized_dist", "归一化", callback=self._invalidate, tooltip=("All dimensions are (implicitly) scaled to a common" "scale to normalize the influence across the domain."), stateWhenDisabled=False) _, metric = METRICS[self.metric_idx] self.normalization_check.setEnabled(metric.supports_normalization) gui.auto_apply(self.controlArea, self, "autocommit") self.layout().setSizeConstraint(self.layout().SetFixedSize)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.corpus = None # Browse file box fbox = gui.widgetBox(self.controlArea, "语料库文件", orientation=0) self.file_widget = widgets.FileWidget( recent_files=self.recent_files, icon_size=(16, 16), on_open=self.open_file, dialog_format=self.dlgFormats, dialog_title='打开橙现智能文档语料库', reload_label='重载', browse_label='浏览', allow_empty=False, minimal_width=250, ) fbox.layout().addWidget(self.file_widget) # dropdown to select title variable self.title_model = DomainModel( valid_types=(StringVariable,), placeholder="(无标题)") gui.comboBox( self.controlArea, self, "title_variable", box="标题变量", model=self.title_model, callback=self.update_feature_selection ) # Used Text Features fbox = gui.widgetBox(self.controlArea, orientation=0) ubox = gui.widgetBox(fbox, "使用的文本特征", addSpace=False) self.used_attrs_model = VariableListModel(enable_dnd=True) self.used_attrs_view = VariablesListItemView() self.used_attrs_view.setModel(self.used_attrs_model) ubox.layout().addWidget(self.used_attrs_view) aa = self.used_attrs_model aa.dataChanged.connect(self.update_feature_selection) aa.rowsInserted.connect(self.update_feature_selection) aa.rowsRemoved.connect(self.update_feature_selection) # Ignored Text Features ibox = gui.widgetBox(fbox, "忽略的文本特征", addSpace=False) self.unused_attrs_model = VariableListModel(enable_dnd=True) self.unused_attrs_view = VariablesListItemView() self.unused_attrs_view.setModel(self.unused_attrs_model) ibox.layout().addWidget(self.unused_attrs_view) # Documentation Data Sets & Report box = gui.hBox(self.controlArea) self.browse_documentation = gui.button( box, self, "浏览文档语料库", callback=lambda: self.file_widget.browse( get_sample_corpora_dir()), autoDefault=False, ) # load first file self.file_widget.select(0) self.update_output_info() self.update_input_info(None)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.corpus: Optional[Corpus] = None self.words: Optional[List] = None self._results: Optional[Results] = None self.__pending_selection = self.selection self._setup_gui()
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.corpus: Optional[Corpus] = None self.words: Optional[List] = None self.__cached_keywords = {} self.model = KeywordsTableModel(parent=self) self._setup_gui()
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.aggregators = AGGREGATORS self.corpus = None self.new_corpus = None self._setup_layout()
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) dynamic_canvas = FigureCanvas(Figure(figsize=(5, 3))) self._dynamic_ax = dynamic_canvas.figure.subplots() self._dynamic_ax.axis('off') self.controlArea.layout().addWidget(dynamic_canvas)
def __init__(self,parent=None, signalManager = None): OWWidget.__init__(self, parent, signalManager, "Sieve diagram", True) #self.controlArea.setMinimumWidth(250) #set default settings self.data = None self.attrX = "" self.attrY = "" self.attrCondition = "" self.attrConditionValue = "" self.showLines = 1 self.showCases = 0 self.showInColor = 1 self.attributeSelectionList = None self.stopCalculating = 0 self.canvas = QGraphicsScene() self.canvasView = QGraphicsView(self.canvas, self.mainArea) self.mainArea.layout().addWidget(self.canvasView) self.canvasView.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.canvasView.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) #GUI self.attrSelGroup = gui.widgetBox(self.controlArea, box = "Shown attributes") self.attrXCombo = gui.comboBox(self.attrSelGroup, self, value="attrX", label="X attribute:", orientation="horizontal", tooltip = "Select an attribute to be shown on the X axis", callback = self.updateGraph, sendSelectedValue = 1, valueType = str, labelWidth = 70) self.attrYCombo = gui.comboBox(self.attrSelGroup, self, value="attrY", label="Y attribute:", orientation="horizontal", tooltip = "Select an attribute to be shown on the Y axis", callback = self.updateGraph, sendSelectedValue = 1, valueType = str, labelWidth = 70) gui.separator(self.controlArea) self.conditionGroup = gui.widgetBox(self.controlArea, box = "Condition") self.attrConditionCombo = gui.comboBox(self.conditionGroup, self, value="attrCondition", label="Attribute:", orientation="horizontal", callback = self.updateConditionAttr, sendSelectedValue = 1, valueType = str, labelWidth = 70) self.attrConditionValueCombo = gui.comboBox(self.conditionGroup, self, value="attrConditionValue", label="Value:", orientation="horizontal", callback = self.updateGraph, sendSelectedValue = 1, valueType = str, labelWidth = 70) gui.separator(self.controlArea) box2 = gui.widgetBox(self.controlArea, box = "Visual settings") gui.checkBox(box2, self, "showLines", "Show squares (observed frequency)", callback = self.updateGraph) hbox = gui.widgetBox(box2, orientation = "horizontal") gui.checkBox(hbox, self, "showCases", "Show data instances...", callback = self.updateGraph) gui.checkBox(hbox, self, "showInColor", "...in color", callback = self.updateGraph) gui.separator(self.controlArea) # self.optimizationDlg = OWSieveOptimization(self, self.signalManager) # optimizationButtons = gui.widgetBox(self.controlArea, "Dialogs", orientation = "horizontal") # gui.button(optimizationButtons, self, "VizRank", callback = self.optimizationDlg.reshow, debuggingEnabled = 0, tooltip = "Find attribute groups with highest value dependency") gui.rubber(self.controlArea) # self.wdChildDialogs = [self.optimizationDlg] # used when running widget debugging # self.graphButton.clicked.connect(self.saveToFileCanvas) self.icons = gui.attributeIconDict self.resize(800, 550) random.seed() self.graphButton.clicked.connect(self.save_graph)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.__results = None # type: Optional[Results] self.data = None # type: Optional[Table] self.model = None # type: Optional[Model] self._violin_plot = None # type: Optional[ViolinPlot] self.setup_gui() self.__pending_selection = self.selection
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.languages = list(LANGS_TO_ISO.keys()) self.aggregators = AGGREGATORS self.corpus = None self.new_corpus = None self._setup_layout()
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self._setup_control_area() self._setup_main_area() self.corpus = None self.words = None # saves scores avoid multiple computation of the same score self.scores = {}
def __init__(self,parent=None, signalManager = None): OWWidget.__init__(self, parent, signalManager, "Sieve diagram", True) #self.controlArea.setMinimumWidth(250) #set default settings self.data = None self.attrX = "" self.attrY = "" self.attrCondition = "" self.attrConditionValue = "" self.showLines = 1 self.showCases = 0 self.showInColor = 1 self.attributeSelectionList = None self.stopCalculating = 0 self.canvas = QGraphicsScene() self.canvasView = QGraphicsView(self.canvas, self.mainArea) self.mainArea.layout().addWidget(self.canvasView) self.canvasView.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.canvasView.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) #GUI self.attrSelGroup = gui.widgetBox(self.controlArea, box = "Shown attributes") self.attrXCombo = gui.comboBox(self.attrSelGroup, self, value="attrX", label="X attribute:", orientation="horizontal", tooltip = "Select an attribute to be shown on the X axis", callback = self.updateGraph, sendSelectedValue = 1, valueType = str, labelWidth = 70) self.attrYCombo = gui.comboBox(self.attrSelGroup, self, value="attrY", label="Y attribute:", orientation="horizontal", tooltip = "Select an attribute to be shown on the Y axis", callback = self.updateGraph, sendSelectedValue = 1, valueType = str, labelWidth = 70) gui.separator(self.controlArea) self.conditionGroup = gui.widgetBox(self.controlArea, box = "Condition") self.attrConditionCombo = gui.comboBox(self.conditionGroup, self, value="attrCondition", label="Attribute:", orientation="horizontal", callback = self.updateConditionAttr, sendSelectedValue = 1, valueType = str, labelWidth = 70) self.attrConditionValueCombo = gui.comboBox(self.conditionGroup, self, value="attrConditionValue", label="Value:", orientation="horizontal", callback = self.updateGraph, sendSelectedValue = 1, valueType = str, labelWidth = 70) gui.separator(self.controlArea) box2 = gui.widgetBox(self.controlArea, box = "Visual settings") gui.checkBox(box2, self, "showLines", "Show lines", callback = self.updateGraph) hbox = gui.widgetBox(box2, orientation = "horizontal") gui.checkBox(hbox, self, "showCases", "Show data examples...", callback = self.updateGraph) gui.checkBox(hbox, self, "showInColor", "...in color", callback = self.updateGraph) gui.separator(self.controlArea) # self.optimizationDlg = OWSieveOptimization(self, self.signalManager) # optimizationButtons = gui.widgetBox(self.controlArea, "Dialogs", orientation = "horizontal") # gui.button(optimizationButtons, self, "VizRank", callback = self.optimizationDlg.reshow, debuggingEnabled = 0, tooltip = "Find attribute groups with highest value dependency") gui.rubber(self.controlArea) # self.wdChildDialogs = [self.optimizationDlg] # used when running widget debugging # self.graphButton.clicked.connect(self.saveToFileCanvas) self.icons = gui.attributeIconDict self.resize(800, 550) random.seed()
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.data = None # type: Table self.n_inliers = None # type: int self.n_outliers = None # type: int self.editors = None # type: Tuple[ParametersEditor] self.current_editor = None # type: ParametersEditor self.method_combo = None # type: QComboBox self.init_gui()
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.embedders = sorted(list(EMBEDDERS_INFO), key=lambda k: EMBEDDERS_INFO[k]["order"]) self._image_attributes = None self._input_data = None self._log = logging.getLogger(__name__) self._task = None self._setup_layout()
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.__results = None # type: Optional[Results] self.model = None # type: Optional[Model] self.background_data = None # type: Optional[Table] self.data = None # type: Optional[Table] self._stripe_plot = None # type: Optional[StripePlot] self.mo_info = "" self.bv_info = "" self.setup_gui()
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self._corpus_to_network = None self.corpus = None self.node_types = ["Document", "Word"] self._task_state = "waiting" self._setup_layout() if Network is None: self.Error.no_network_addon()
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) # Init data self.data = None self.selected_data = None # used for transforming the 'selected data' into the 'data' domain self.selected_data_transformed = None self.results = Result() # info box fbox = gui.widgetBox(self.controlArea, "Info") self.info_fil = gui.label(fbox, self, 'Words displayed: 0') # Filtering settings fbox = gui.widgetBox(self.controlArea, "Filter") hbox = gui.widgetBox(fbox, orientation=0) self.chb_p = gui.checkBox(hbox, self, "filter_by_p", "p-value", callback=self.filter_and_display, tooltip="Filter by word p-value") self.spin_p = gui.doubleSpin(hbox, self, 'filter_p_value', 1e-4, 1, step=1e-4, labelWidth=15, callback=self.filter_and_display, tooltip="Max p-value for word") self.spin_p.setEnabled(self.filter_by_p) hbox = gui.widgetBox(fbox, orientation=0) self.chb_fdr = gui.checkBox(hbox, self, "filter_by_fdr", "FDR", callback=self.filter_and_display, tooltip="Filter by word FDR") self.spin_fdr = gui.doubleSpin(hbox, self, 'filter_fdr_value', 1e-4, 1, step=1e-4, labelWidth=15, callback=self.filter_and_display, tooltip="Max p-value for word") self.spin_fdr.setEnabled(self.filter_by_fdr) gui.rubber(self.controlArea) gui.auto_send(self.buttonsArea, self, "auto_apply") # Word's list view self.cols = ['Word', 'p-value', 'FDR'] self.sig_words = QTreeWidget() self.sig_words.setColumnCount(len(self.cols)) self.sig_words.setHeaderLabels(self.cols) self.sig_words.setSortingEnabled(True) self.sig_words.setSelectionMode(QTreeView.NoSelection) self.sig_words.sortByColumn(1, 0) # 0 is ascending order for i in range(len(self.cols)): self.sig_words.resizeColumnToContents(i) self.mainArea.layout().addWidget(self.sig_words)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.__results = None # type: Optional[Results] self.data = None # type: Optional[Table] self.model = None # type: Optional[Model] self._violin_plot = None # type: Optional[ViolinPlot] self.setup_gui() self.__pending_selection = self.selection initial = ViolinPlot().parameter_setter.initial_settings VisualSettingsDialog(self, initial)
def __init__(self) -> None: OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.corpus = None # the list with combos from the widget self.combos = [] # the list with line edits from the widget self.line_edits = [] # the list of buttons in front of controls that removes them self.remove_buttons = [] self._init_controls()
def __init__(self): OWWidget.__init__(self) self.data = None self.topic_list = [] self.term_topic_matrix = None self.term_frequency = None self.num_tokens = None # should be used later for bar chart self.graph: Optional[BarPlotGraph] = None self._create_layout() VisualSettingsDialog(self, self.graph.parameter_setter.initial_settings)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.frame = None self.animation = BouncingBalls() self.timer = QTimer() self.timer.timeout.connect(self.pygame_loop) self.timer.start(10) self.image = None self.current_colors = None
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.results: Optional[BaseResults] = None self.data: Optional[Table] = None self.model: Optional[Model] = None self.plot: Optional[FeaturesPlot] = None self.scene: Optional[GraphicsScene] = None self.view: Optional[GraphicsView] = None self.setup_gui() self.__pending_selection = self.selection initial = self.PLOT_CLASS().parameter_setter.initial_settings VisualSettingsDialog(self, initial)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.data = None self.selected_attributes = None box = gui.vBox(self.controlArea, "Granger Test") gui.hSlider( box, self, "confidence", minValue=90, maxValue=99, label="Confidence:", labelFormat=" %d%%", callback=self._setting_changed, ) gui.spin( box, self, "max_lag", 1, 50, label="Max lag:", callback=self._setting_changed, ) self.test_button = gui.button(box, self, "&Test", self._toggle_run) gui.rubber(self.controlArea) self.model = model = PyTableModel(parent=self) model.setHorizontalHeaderLabels(COLUMNS) self.causality_view = view = gui.TableView(self) view.setModel(model) bold = view.BoldFontDelegate(self) view.setItemDelegateForColumn(2, bold) view.setItemDelegateForColumn(4, bold) view.horizontalHeader().setStretchLastSection(False) view.horizontalHeader().sectionClicked.connect(self.header_click) view.selectionModel().selectionChanged.connect(self.on_select) view.sortByColumn(1, Qt.AscendingOrder) self.mainArea.layout().addWidget(view) self._set_modified(False) self.auto_commit_widget = gui.auto_commit( widget=self.controlArea, master=self, value="autocommit", label="Apply", commit=self.commit, )
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.n_topic_words = 0 self.documents_info_str = "" self.webview = None self.topic = None self.corpus = None self.corpus_counter = None self.wordlist = None self.shown_words = None self.shown_weights = None self.combined_size_length = None self._create_layout() self.on_corpus_change(None)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.__onto_handler = OntologyHandler() flags = Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsEditable self.__model = PyListModel([], self, flags=flags) self.__input_model = QStandardItemModel() self.__library_view: QListView = None self.__input_view: ListViewSearch = None self.__ontology_view: EditableTreeView = None self.ontology_info = "" self._setup_gui() self._restore_state() self.settingsAboutToBePacked.connect(self._save_state)
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.data = None # self.apply is changed later, pylint: disable=unnecessary-lambda box = gui.radioButtons(self.controlArea, self, "feature_type", box="Feature names", callback=lambda: self.apply()) button = gui.appendRadioButton(box, "Generic") edit = gui.lineEdit(gui.indentedBox(box, gui.checkButtonOffsetHint(button)), self, "feature_name", placeholderText="Type a prefix ...", toolTip="Custom feature name") edit.editingFinished.connect(self._apply_editing) self.meta_button = gui.appendRadioButton(box, "From variable:") self.feature_model = DomainModel(valid_types=(ContinuousVariable, StringVariable), alphabetical=False) self.feature_combo = gui.comboBox(gui.indentedBox( box, gui.checkButtonOffsetHint(button)), self, "feature_names_column", contentsLength=12, searchable=True, callback=self._feature_combo_changed, model=self.feature_model) self.remove_check = gui.checkBox(gui.indentedBox( box, gui.checkButtonOffsetHint(button)), self, "remove_redundant_inst", "Remove redundant instance", callback=lambda: self.apply()) gui.auto_apply(self.buttonsArea, self, commit=self.apply) self.info.set_input_summary(self.info.NoInput) self.info.set_output_summary(self.info.NoOutput) self.set_controls()
def __init__(self): OWWidget.__init__(self) ConcurrentWidgetMixin.__init__(self) self.learner: Optional[CoxRegressionLearner] = CoxRegressionLearner() self.data: Optional[Table] = None self.trace: Optional[List[Result]] = None gui.rubber(self.controlArea) self.graph: StepwiseCoxRegressionPlot = StepwiseCoxRegressionPlot( parent=self) self.graph.selection_line_moved.connect(self.on_selection_changed) self.mainArea.layout().addWidget(self.graph) self.graph.setAntialiasing(True) gui.rubber(self.controlArea) self.commit_button = gui.auto_commit(self.controlArea, self, 'auto_commit', '&Commit', box=False)
def __init__(self, parent=None, signalManager = None): OWWidget.__init__(self, parent, signalManager, "Scatterplot (Qt)", True) ##TODO tukaj mas testni graf! self.graph = OWScatterPlotGraphQt_test(self, self.mainArea, "ScatterPlotQt_test") #add a graph widget ##TODO pazi # self.mainArea.layout().addWidget(self.graph.pgPlotWidget) # tale je zaresni self.mainArea.layout().addWidget(self.graph.glw) # tale je testni ## TODO spodaj je se en POZOR, kjer nastavis palette # self.vizrank = OWVizRank(self, self.signalManager, self.graph, orngVizRank.SCATTERPLOT, "ScatterPlotQt") # self.optimizationDlg = self.vizrank # local variables self.showGridlines = 1 self.autoSendSelection = 1 self.toolbarSelection = 0 self.classificationResults = None self.outlierValues = None self.colorSettings = None self.selectedSchemaIndex = 0 self.graph.sendSelectionOnUpdate = 0 self.attributeSelectionList = None self.data = None self.subsetData = None #load settings # self.loadSettings() self.graph.setShowXaxisTitle() self.graph.setShowYLaxisTitle() # self.connect(self.graphButton, SIGNAL("clicked()"), self.graph.saveToFile) box1 = gui.widgetBox(self.controlArea, "Axis Variables") #x attribute self.attrX = "" self.attrXCombo = gui.comboBox(box1, self, "attrX", label="X-Axis:", labelWidth=50, orientation="horizontal", callback = self.majorUpdateGraph, sendSelectedValue = 1, valueType = str) # y attribute self.attrY = "" self.attrYCombo = gui.comboBox(box1, self, "attrY", label="Y-Axis:", labelWidth=50, orientation="horizontal", callback = self.majorUpdateGraph, sendSelectedValue = 1, valueType = str) box2 = gui.widgetBox(self.controlArea, "Point Properties") self.attrColor = "" self.attrColorCombo = gui.comboBox(box2, self, "attrColor", label="Color:", labelWidth=50, orientation="horizontal", callback = self.updateGraph, sendSelectedValue=1, valueType = str, emptyString = "(Same color)") # labelling self.attrLabel = "" self.attrLabelCombo = gui.comboBox(box2, self, "attrLabel", label="Label:", labelWidth=50, orientation="horizontal", callback = self.updateGraph, sendSelectedValue = 1, valueType = str, emptyString = "(No labels)") # shaping self.attrShape = "" self.attrShapeCombo = gui.comboBox(box2, self, "attrShape", label="Shape:", labelWidth=50, orientation="horizontal", callback = self.updateGraph, sendSelectedValue=1, valueType = str, emptyString = "(Same shape)") # sizing self.attrSize = "" self.attrSizeCombo = gui.comboBox(box2, self, "attrSize", label="Size:", labelWidth=50, orientation="horizontal", callback = self.updateGraph, sendSelectedValue=1, valueType = str, emptyString = "(Same size)") g = self.graph.gui box3 = g.point_properties_box(self.controlArea) # self.jitterSizeCombo = gui.comboBox(box3, self, "graph.jitter_size", label = 'Jittering size (% of size):'+' ', orientation = "horizontal", callback = self.resetGraphData, items = self.jitterSizeNums, sendSelectedValue = 1, valueType = float) ## TODO: jitter size slider ima samo interger values -> ali lahko slajda po self.jitterSizeNums gui.hSlider(box3, self, value='graph.jitter_size', label='Jittering (%): ', minValue=1, maxValue=10, callback=self.resetGraphData) gui.checkBox(gui.indentedBox(box3), self, 'graph.jitter_continuous', 'Jitter continuous values', callback = self.resetGraphData, tooltip = "Does jittering apply also on continuous attributes?") gui.button(box3, self, "Set Colors", self.setColors, tooltip = "Set the canvas background color, grid color and color palette for coloring continuous variables") box4 = gui.widgetBox(self.controlArea, "Plot Properties") g.add_widgets([g.ShowLegend, g.ShowGridLines], box4) # gui.comboBox(box4, self, "graph.tooltipKind", items = ["Don't Show Tooltips", "Show Visible Attributes", "Show All Attributes"], callback = self.updateGraph) gui.checkBox(box4, self, value='graph.tooltipShowsAllAttributes', label='Show all attributes in tooltip') box5 = gui.widgetBox(self.controlArea, "Auto Send Selected Data When...") gui.checkBox(box5, self, 'autoSendSelection', 'Adding/Removing selection areas', callback = self.selectionChanged, tooltip = "Send selected data whenever a selection area is added or removed") gui.checkBox(box5, self, 'graph.sendSelectionOnUpdate', 'Moving/Resizing selection areas', tooltip = "Send selected data when a user moves or resizes an existing selection area") self.graph.selection_changed.connect(self.selectionChanged) # zooming / selection self.zoomSelectToolbar = g.zoom_select_toolbar(self.controlArea, buttons = g.default_zoom_select_buttons + [g.Spacing, g.ShufflePoints]) self.connect(self.zoomSelectToolbar.buttons[g.SendSelection], SIGNAL("clicked()"), self.sendSelections) self.connect(self.zoomSelectToolbar.buttons[g.Zoom], SIGNAL("clicked()",), self.graph.zoomButtonClicked) self.connect(self.zoomSelectToolbar.buttons[g.Pan], SIGNAL("clicked()",), self.graph.panButtonClicked) self.connect(self.zoomSelectToolbar.buttons[g.Select], SIGNAL("clicked()",), self.graph.selectButtonClicked) self.controlArea.layout().addStretch(100) self.icons = gui.attributeIconDict self.debugSettings = ["attrX", "attrY", "attrColor", "attrLabel", "attrShape", "attrSize"] # self.wdChildDialogs = [self.vizrank] # used when running widget debugging dlg = self.createColorDialog() self.graph.contPalette = dlg.getContinuousPalette("contPalette") self.graph.discPalette = dlg.getDiscretePalette("discPalette") ##TODO POZOR! # p = self.graph.pgPlotWidget.palette() p = self.graph.glw.palette() p.setColor(OWPalette.Canvas, dlg.getColor("Canvas")) p.setColor(OWPalette.Grid, dlg.getColor("Grid")) self.graph.set_palette(p) self.graph.enableGridXB(self.showGridlines) self.graph.enableGridYL(self.showGridlines) # self.graph.resize(700, 550) self.mainArea.setMinimumWidth(700) self.mainArea.setMinimumHeight(550)