def __init__(self, vData, app, parent=None): layeredWidget.__init__(self, parent) self.vData = vData self.app = app self.svgLayer = mutableSvgLayer('gui/svg/parallelCoordinates.svg',self) self.addLayer(self.svgLayer) self.axes = {} self.axisOrder = sorted(self.vData.axisLookups.iterkeys()) self.numVisibleAxes = len(self.axisOrder) prototype = self.svgLayer.svg.axis self.axisTop = prototype.top() self.axisWidth = prototype.spacer.width() self.columnConversion = 1.0/self.axisWidth self.axisHeight = prototype.spacer.height() for att in self.axisOrder: current = prototype.clone() self.axes[att] = axisHandler(att,self.vData,current,True,self) self.axes[att].updateParams(self.app.intMan.activeParams[att]) prototype.delete() self.dragStartPixel = None self.dragStartIndex = None self.dragAxis = None self.dragTargetPixel = None self.numericRangeAxis = None self.normalCursor = QCursor(Qt.CrossCursor) self.mouseOverCursor = self.svgLayer.svg.generateCursor(self.svgLayer.svg.rangeCursor) self.mouseOverRadius = self.svgLayer.svg.rangeCursor.height()/2 self.setCursor(self.normalCursor) self.svgLayer.svg.rangeCursor.delete() self.normalHandleColor = self.svgLayer.svg.normalHandleBackground.getAttribute('fill') self.activeHandleColor = self.svgLayer.svg.activeHandleBackground.getAttribute('fill') self.lastMouseAxis = None self.lastMouseLabel = None self.lastMouseNumeric = None self.highlightedLayer = selectionLayer(self.svgLayer.size,False,self,self.svgLayer.svg.highlightedLinePrototype) self.addLayer(self.highlightedLayer,0) self.selectedLayer = selectionLayer(self.svgLayer.size,False,self,self.svgLayer.svg.selectedLinePrototype,opaqueBack=True) self.addLayer(self.selectedLayer,0) self.alignAxes(set())
def __init__(self, data, parent = None): layeredWidget.__init__(self, parent) self.data = data self.svgLayer = mutableSvgLayer('gui/svg/groupTags.svg',self) self.addLayer(self.svgLayer) self.prototypeGroupBlock = self.svgLayer.svg.getElement('groupBlock') self.prototypeIndividualBlock = self.svgLayer.svg.getElement('individualBlock') self.wOffset = self.prototypeGroupBlock.background.left() self.visItems = [(True,self.prototypeGroupBlock),(False,self.prototypeIndividualBlock)] self.tags = {} self.updateList() self.peeling = None
def __init__(self, vData, app, parent = None): layeredWidget.__init__(self, parent) self.vData = vData self.app = app self.svgLayer = mutableSvgLayer('gui/svg/scatterplot.svg',self) self.addLayer(self.svgLayer) self.cursorXradius = self.svgLayer.svg.pointCursor.width()/2 self.cursorYradius = self.svgLayer.svg.pointCursor.height()/2 self.normalCursor = QCursor(Qt.CrossCursor) self.highlightCursor = self.svgLayer.svg.generateCursor(self.svgLayer.svg.pointCursor) self.svgLayer.svg.pointCursor.hide() self.setCursor(self.normalCursor) self.scatterBounds = self.svgLayer.svg.scatterBounds.getBounds() self.highlightedLayer = selectionLayer(self.svgLayer.size,False,self,self.svgLayer.svg.highlightedDotPrototype) self.addLayer(self.highlightedLayer,0) self.selectedLayer = selectionLayer(self.svgLayer.size,False,self,self.svgLayer.svg.selectedDotPrototype) self.addLayer(self.selectedLayer,0) self.allDataLayer = rasterLayer(self.svgLayer.size,False,self) self.addLayer(self.allDataLayer,0) self.xRanges = [self.svgLayer.svg.xRange] self.yRanges = [self.svgLayer.svg.yRange] self.notifyAxisChange(True) self.draggedHandle = None self.draggedAxisIsX = None self.draggedBoundIsLow = None self.draggedDistance = None self.draggedStart = None
def updateList(self): self.clearAllLayers() rows = self.getCurrentRows() if len(rows) == 0: return self.svgLayer = mutableSvgLayer('gui/svg/fileTags.svg',self) w = 0 h = 0 prototypeGroupBlock = self.svgLayer.svg.getElement('groupBlock') prototypeIndividualBlock = self.svgLayer.svg.getElement('individualBlock') prototypeTag = self.svgLayer.svg.getElement('tag') wOffset = prototypeGroupBlock.background.left() groupClones = [] individualClones = [] lastFile = None for r in rows: if len(r) == 3: # File newGroupBlock = prototypeGroupBlock.clone() newGroupBlock.moveTo(0,h) newGroupBlock.label.setText(r[0]) newGroupBlock.setAttribute('___associatedFile',r[0]) lastFile = r[0] offset = newGroupBlock.height() w = max(24 + 6*len(r[0]),w) # this is some hacking... QSvgRenderer can't properly determine the bounding box of text elements groupClones.append(newGroupBlock) if r[1] != False: newGroupBlock.arrow.hide() if r[1] != True: newGroupBlock.downArrow.hide() if r[2] != None: newGroupBlock.checkBox.dash.hide() if r[2] != True: newGroupBlock.checkBox.check.hide() else: newIndividualBlock = prototypeIndividualBlock.clone() newIndividualBlock.moveTo(0,h) newIndividualBlock.label.setText(r[0]) assert lastFile != None newIndividualBlock.setAttribute('___associatedFile',lastFile) offset = newIndividualBlock.height() w = max(24 + 6*len(r[0]),w) # this is some hacking... QSvgRenderer can't properly determine the bounding box of text elements individualClones.append(newIndividualBlock) if r[1] != True: newIndividualBlock.checkBox.check.hide() h += offset # kill off the prototypes prototypeGroupBlock.delete() prototypeIndividualBlock.delete() prototypeTag.delete() # Apply the new widths for c in groupClones: c.background.setSize(w,c.height()) for c in individualClones: c.background.setSize(w,c.height()) self.svgLayer.resize(QSize(w+wOffset,h)) self.addLayer(self.svgLayer)