Example #1
0
    def view(self, viewTblELR=None, newInstance=None):
        if newInstance is not None:
            self.modelXbrl = newInstance # a save operation has created a new instance to use subsequently
        if viewTblELR:  # specific table selection
            self.tblELR = viewTblELR
        else:   # first or subsequenct reloading (language, dimensions, other change)
            self.loadTablesMenu()  # load menus (and initialize if first time
            viewTblELR = self.tblELR

        # remove old widgets
        self.viewFrame.clearGrid()

        tblAxisRelSet, xAxisObj, yAxisObj, zAxisObjs = getTblAxes(self, viewTblELR) 
        if self.zComboBoxIndex is None:
            self.zComboBoxIndex = list(repeat(0, len(zAxisObjs))) # start with 0 indices
            self.zFilterIndex = list(repeat(0, len(zAxisObjs)))
        
        if tblAxisRelSet:
            
            gridHdr(self.gridTblHdr, 0, 0, 
                    self.roledefinition, 
                    anchor="nw",
                    #columnspan=(self.dataFirstCol - 1),
                    #rowspan=(self.dataFirstRow),
                    wraplength=200) # in screen units
            zFilters = []
            for i, zAxisObj in enumerate(zAxisObjs):
                self.zAxis(1 + i, zAxisObj, zFilters)
            xFilters = []
            self.xAxis(self.dataFirstCol, self.colHdrTopRow, self.colHdrTopRow + self.colHdrRows - 1, 
                       xAxisObj, xFilters, self.xAxisChildrenFirst.get(), True, True)
            self.yAxis(1, self.dataFirstRow,
                       yAxisObj, self.yAxisChildrenFirst.get(), True, True)
            self.factPrototypes = []
            self.bodyCells(self.dataFirstRow, yAxisObj, xFilters, zFilters, self.yAxisChildrenFirst.get())
Example #2
0
    def view(self, viewTblELR=None):
        if viewTblELR:  # specific table selection
            self.tblELR = viewTblELR
        else:   # first or subsequenct reloading (language, dimensions, other change)
            self.loadTablesMenu()  # load menus (and initialize if first time
            viewTblELR = self.tblELR

        # remove old widgets
        self.viewFrame.clearGrid()

        tblAxisRelSet, xAxisObj, yAxisObj, zAxisObj = getTblAxes(self, viewTblELR) 
        
        if tblAxisRelSet:
            
            gridHdr(self.gridTblHdr, 0, 0, 
                    self.roledefinition, 
                    anchor="nw",
                    #columnspan=(self.dataFirstCol - 1),
                    #rowspan=(self.dataFirstRow),
                    wraplength=200) # in screen units
            zFilters = []
            self.zAxis(1, zAxisObj, zFilters)
            xFilters = []
            self.xAxis(self.dataFirstCol, self.colHdrTopRow, self.colHdrTopRow + self.colHdrRows - 1, 
                       xAxisObj, xFilters, self.xAxisChildrenFirst.get(), True, True)
            self.yAxis(1, self.dataFirstRow,
                       yAxisObj, self.yAxisChildrenFirst.get(), True, True)
            self.factPrototypes = []
            self.bodyCells(self.dataFirstRow, yAxisObj, xFilters, zFilters, self.yAxisChildrenFirst.get())
    def view(self, viewTblELR=None):
        if viewTblELR is None:
            tblRelSet = self.modelXbrl.relationshipSet("Table-rendering")
            for tblLinkroleUri in tblRelSet.linkRoleUris:
                viewTblELR = tblLinkroleUri # take first table
                break
        self.tblELR = viewTblELR

        tblAxisRelSet, xAxisObj, yAxisObj, zAxisObjs = getTblAxes(self, viewTblELR) 
        if self.zComboBoxIndex is None:
            self.zComboBoxIndex = list(repeat(0, len(zAxisObjs))) # start with 0 indices
            self.zFilterIndex = list(repeat(0, len(zAxisObjs)))
        
        if tblAxisRelSet and self.tblElt is not None:
            self.rowElts = [etree.SubElement(self.tblElt, "{http://www.w3.org/1999/xhtml}tr")
                            for r in range(self.dataFirstRow + self.dataRows - 1)]
            etree.SubElement(self.rowElts[0], "{http://www.w3.org/1999/xhtml}th",
                             attrib={"class":"tableHdr",
                                     "style":"max-width:100em;",
                                     "colspan": str(self.dataFirstCol - 1),
                                     "rowspan": str(self.dataFirstRow - 1)}
                             ).text = self.roledefinition
            
            zFilters = []
            for i, zAxisObj in enumerate(zAxisObjs):
                self.zAxis(1 + i, zAxisObj, zFilters)
            xFilters = []
            self.xAxis(self.dataFirstCol, self.colHdrTopRow, self.colHdrTopRow + self.colHdrRows - 1, 
                       xAxisObj, xFilters, self.xAxisChildrenFirst.get(), True, True)
            self.yAxis(1, self.dataFirstRow,
                       yAxisObj, self.yAxisChildrenFirst.get(), True, True)
            self.bodyCells(self.dataFirstRow, yAxisObj, xFilters, zFilters, self.yAxisChildrenFirst.get())
Example #4
0
    def view(self, viewTblELR=None):
        if viewTblELR is None:
            tblRelSet = self.modelXbrl.relationshipSet("Table-rendering")
            for tblLinkroleUri in tblRelSet.linkRoleUris:
                viewTblELR = tblLinkroleUri # take first table
                break
        self.tblELR = viewTblELR

        tblAxisRelSet, xAxisObj, yAxisObj, zAxisObj = getTblAxes(self, viewTblELR) 
        
        self.tblElt = None
        for self.tblElt in self.htmlDoc.iter(tag="{http://www.w3.org/1999/xhtml}table"):
            break
        
        if tblAxisRelSet and self.tblElt is not None:
            self.rowElts = [etree.SubElement(self.tblElt, "{http://www.w3.org/1999/xhtml}tr")
                            for r in range(self.dataFirstRow + self.dataRows - 1)]
            etree.SubElement(self.rowElts[0], "{http://www.w3.org/1999/xhtml}th",
                             attrib={"class":"tableHdr",
                                     "style":"max-width:100em;",
                                     "colspan": str(self.dataFirstCol - 1),
                                     "rowspan": str(self.dataFirstRow - 1)}
                             ).text = self.roledefinition
            
            zFilters = []
            self.zAxis(1, zAxisObj, zFilters)
            xFilters = []
            self.xAxis(self.dataFirstCol, self.colHdrTopRow, self.colHdrTopRow + self.colHdrRows - 1, 
                       xAxisObj, xFilters, self.xAxisChildrenFirst.get(), True, True)
            self.yAxis(1, self.dataFirstRow,
                       yAxisObj, self.yAxisChildrenFirst.get(), True, True)
            self.bodyCells(self.dataFirstRow, yAxisObj, xFilters, zFilters, self.yAxisChildrenFirst.get())
Example #5
0
    def view(self, viewTblELR=None, newInstance=None):
        startedAt = time.time()
        self.blockMenuEvents += 1
        if newInstance is not None:
            self.modelXbrl = newInstance # a save operation has created a new instance to use subsequently
            clearZchoices = False
        if viewTblELR:  # specific table selection
            self.tblELR = viewTblELR
            clearZchoices = True
        else:   # first or subsequenct reloading (language, dimensions, other change)
            self.loadTablesMenu()  # load menus (and initialize if first time
            viewTblELR = self.tblELR
            clearZchoices = self.zOrdinateChoices is None

        if clearZchoices:
            self.zOrdinateChoices = {}

        # remove old widgets
        self.viewFrame.clearGrid()

        tblAxisRelSet, xOrdCntx, yOrdCntx, zOrdCntx = getTblAxes(self, viewTblELR) 
        
        if tblAxisRelSet:
            
            gridHdr(self.gridTblHdr, 0, 0, 
                    self.roledefinition, 
                    anchor="nw",
                    #columnspan=(self.dataFirstCol - 1),
                    #rowspan=(self.dataFirstRow),
                    wraplength=200) # in screen units
            zAspects = defaultdict(set)
            self.zAxis(1, zOrdCntx, zAspects, clearZchoices)
            xOrdCntxs = []
            self.xAxis(self.dataFirstCol, self.colHdrTopRow, self.colHdrTopRow + self.colHdrRows - 1, 
                       xOrdCntx, xOrdCntxs, self.xAxisChildrenFirst.get(), True, True)
            self.yAxis(1, self.dataFirstRow,
                       yOrdCntx, self.yAxisChildrenFirst.get(), True, True)
            for fp in self.factPrototypes: # dereference prior facts
                fp.clear()
            self.factPrototypes = []
            self.bodyCells(self.dataFirstRow, yOrdCntx, xOrdCntxs, zAspects, self.yAxisChildrenFirst.get())
                
            # data cells
                
        self.modelXbrl.profileStat("viewTable_" + os.path.basename(viewTblELR), time.time() - startedAt)

        #self.gridView.config(scrollregion=self.gridView.bbox(constants.ALL))
        self.blockMenuEvents -= 1
Example #6
0
    def view(self, viewTblELR=None, newInstance=None):
        if newInstance is not None:
            self.modelXbrl = newInstance  # a save operation has created a new instance to use subsequently
        if viewTblELR:  # specific table selection
            self.tblELR = viewTblELR
        else:  # first or subsequenct reloading (language, dimensions, other change)
            self.loadTablesMenu()  # load menus (and initialize if first time
            viewTblELR = self.tblELR

        # remove old widgets
        self.viewFrame.clearGrid()

        tblAxisRelSet, xAxisObj, yAxisObj, zAxisObjs = getTblAxes(
            self, viewTblELR)
        if self.zComboBoxIndex is None:
            self.zComboBoxIndex = list(repeat(
                0, len(zAxisObjs)))  # start with 0 indices
            self.zFilterIndex = list(repeat(0, len(zAxisObjs)))

        if tblAxisRelSet:

            gridHdr(
                self.gridTblHdr,
                0,
                0,
                self.roledefinition,
                anchor="nw",
                #columnspan=(self.dataFirstCol - 1),
                #rowspan=(self.dataFirstRow),
                wraplength=200)  # in screen units
            zFilters = []
            for i, zAxisObj in enumerate(zAxisObjs):
                self.zAxis(1 + i, zAxisObj, zFilters)
            xFilters = []
            self.xAxis(self.dataFirstCol, self.colHdrTopRow,
                       self.colHdrTopRow + self.colHdrRows - 1, xAxisObj,
                       xFilters, self.xAxisChildrenFirst.get(), True, True)
            self.yAxis(1, self.dataFirstRow, yAxisObj,
                       self.yAxisChildrenFirst.get(), True, True)
            self.factPrototypes = []
            self.bodyCells(self.dataFirstRow, yAxisObj, xFilters, zFilters,
                           self.yAxisChildrenFirst.get())
Example #7
0
    def view(self, viewTblELR=None):
        if viewTblELR is None:
            tblRelSet = self.modelXbrl.relationshipSet("Table-rendering")
            for tblLinkroleUri in tblRelSet.linkRoleUris:
                viewTblELR = tblLinkroleUri  # take first table
                break
        self.tblELR = viewTblELR

        tblAxisRelSet, xAxisObj, yAxisObj, zAxisObjs = getTblAxes(
            self, viewTblELR)
        if self.zComboBoxIndex is None:
            self.zComboBoxIndex = list(repeat(
                0, len(zAxisObjs)))  # start with 0 indices
            self.zFilterIndex = list(repeat(0, len(zAxisObjs)))

        if tblAxisRelSet and self.tblElt is not None:
            self.rowElts = [
                etree.SubElement(self.tblElt,
                                 "{http://www.w3.org/1999/xhtml}tr")
                for r in range(self.dataFirstRow + self.dataRows - 1)
            ]
            etree.SubElement(self.rowElts[0],
                             "{http://www.w3.org/1999/xhtml}th",
                             attrib={
                                 "class": "tableHdr",
                                 "style": "max-width:100em;",
                                 "colspan": str(self.dataFirstCol - 1),
                                 "rowspan": str(self.dataFirstRow - 1)
                             }).text = self.roledefinition

            zFilters = []
            for i, zAxisObj in enumerate(zAxisObjs):
                self.zAxis(1 + i, zAxisObj, zFilters)
            xFilters = []
            self.xAxis(self.dataFirstCol, self.colHdrTopRow,
                       self.colHdrTopRow + self.colHdrRows - 1, xAxisObj,
                       xFilters, self.xAxisChildrenFirst.get(), True, True)
            self.yAxis(1, self.dataFirstRow, yAxisObj,
                       self.yAxisChildrenFirst.get(), True, True)
            self.bodyCells(self.dataFirstRow, yAxisObj, xFilters, zFilters,
                           self.yAxisChildrenFirst.get())