class ILinePlot(IChart): """A line plot.""" occurence.containing(occurence.One('data', IData2D), occurence.ZeroOrOne('lines', ILines), occurence.ZeroOrOne('xValueAxis', IXValueAxis), occurence.ZeroOrOne('yValueAxis', IYValueAxis), occurence.ZeroOrOne('lineLabels', ILineLabels), *IChart.queryTaggedValue('directives', ())) reversePlotOrder = attr.Boolean( title='Reverse Plot Order', description='When true, the coordinate system is reversed.', required=False) lineLabelNudge = attr.Measurement( title='Line Label Nudge', description='The distance between the data point and its label.', required=False) lineLabelFormat = attr.Text( title='Line Label Format', description='Formatting string for data point labels.', required=False) joinedLines = attr.Boolean( title='Joined Lines', description='When true, connect all data points with lines.', required=False) inFill = attr.Boolean( title='Name', description=('Flag indicating whether the line plot should be filled, ' 'in other words converted to an area chart.'), required=False)
class IDocument(interfaces.IRMLDirectiveSignature): occurence.containing( occurence.ZeroOrOne('docinit', IDocInit), occurence.ZeroOrOne('stylesheet', stylesheet.IStylesheet), occurence.ZeroOrOne('template', template.ITemplate), occurence.ZeroOrOne('story', template.IStory), occurence.ZeroOrOne('pageInfo', canvas.IPageInfo), occurence.ZeroOrMore('pageDrawing', canvas.IPageDrawing), ) filename = attr.String( title=u'File Name', description=(u'The default name of the output file, if no output ' u'file was provided.'), required=True) debug = attr.Boolean( title=u'Debug', description=u'A flag to activate the debug output.', required=False) compression = attr.BooleanWithDefault( title=u'Compression', description=(u'A flag determining whether page compression should ' u'be used.'), required=False) invariant = attr.BooleanWithDefault( title=u'Invariant', description=(u'A flag that determines whether the produced PDF ' u'should be invariant with respect to the date and ' u'the exact contents.'), required=False)
class ILinePlot(IChart): """A line plot.""" occurence.containing(occurence.One('data', IData2D), occurence.ZeroOrOne('lines', ILines), occurence.ZeroOrOne('xValueAxis', IXValueAxis), occurence.ZeroOrOne('yValueAxis', IYValueAxis), occurence.ZeroOrOne('lineLabels', ILineLabels), *IChart.queryTaggedValue('directives', ())) reversePlotOrder = attr.Boolean( title=u'Reverse Plot Order', description=u'When true, the coordinate system is reversed.', required=False) lineLabelNudge = attr.Measurement( title=u'Line Label Nudge', description=u'The distance between the data point and its label.', required=False) lineLabelFormat = attr.String( title=u'Line Label Format', description=u'Formatting string for data point labels.', required=False) joinedLines = attr.Boolean( title=u'Joined Lines', description=u'When true, connect all data points with lines.', required=False)
class ISlice(ISliceBase): """A slice in a pie chart.""" occurence.containing( occurence.ZeroOrOne('label', ISliceLabel), occurence.ZeroOrOne('pointer', ISlicePointer), ) swatchMarker = attr.Symbol(required=False)
class IPieChart(IChart): """A pie chart.""" occurence.containing(occurence.One('data', ISingleData1D), occurence.ZeroOrOne('slices', ISlices), occurence.ZeroOrOne('labels', ISimpleLabels), *IChart.queryTaggedValue('directives', ())) startAngle = attr.Integer( title=u'Start Angle', description=u'The start angle in the chart of the first slice ' u'in degrees.', required=False) direction = attr.Choice( title=u'Direction', description=u'The direction in which the pie chart will be built.', choices=('clockwise', 'anticlockwise'), required=False) checkLabelOverlap = attr.Boolean( title=u'Check Label Overlap', description=(u'When true, check and attempt to fix standard ' u'label overlaps'), required=False) pointerLabelMode = attr.Choice( title=u'Pointer Label Mode', description=(u'The location relative to the slace the label should ' u'be placed.'), choices={ 'none': None, 'leftright': 'LeftRight', 'leftandright': 'LeftAndRight' }, required=False) sameRadii = attr.Boolean( title=u'Same Radii', description=u'When true, make x/y radii the same.', required=False) orderMode = attr.Choice(title=u'Order Mode', description=u'', choices=('fixed', 'alternate'), required=False) xradius = attr.Measurement(title=u'X-Radius', description=u'The radius of the X-directions', required=False) yradius = attr.Measurement(title=u'Y-Radius', description=u'The radius of the Y-directions', required=False)
class IDocument(interfaces.IRMLDirectiveSignature): occurence.containing( occurence.ZeroOrOne('docinit', IDocInit), occurence.ZeroOrOne('stylesheet', stylesheet.IStylesheet), occurence.ZeroOrOne('template', template.ITemplate), occurence.ZeroOrOne('story', template.IStory), occurence.ZeroOrOne('pageInfo', canvas.IPageInfo), occurence.ZeroOrMore('pageDrawing', canvas.IPageDrawing), ) filename = attr.Text( title='File Name', description=('The default name of the output file, if no output ' 'file was provided.'), required=True) title = attr.Text( title='Title', description=('The "Title" annotation for the PDF document.'), required=False) subject = attr.Text( title='Subject', description=('The "Subject" annotation for the PDF document.'), required=False) author = attr.Text( title='Author', description=('The "Author" annotation for the PDF document.'), required=False) creator = attr.Text( title='Creator', description=('The "Creator" annotation for the PDF document.'), required=False) debug = attr.Boolean(title='Debug', description='A flag to activate the debug output.', default=False, required=False) compression = attr.BooleanWithDefault( title='Compression', description=('A flag determining whether page compression should ' 'be used.'), required=False) invariant = attr.BooleanWithDefault( title='Invariant', description=('A flag that determines whether the produced PDF ' 'should be invariant with respect to the date and ' 'the exact contents.'), required=False)
class IBlockTable(interfaces.IRMLDirectiveSignature): """A typical block table.""" occurence.containing( occurence.ZeroOrMore('tr', ITableRow), occurence.ZeroOrOne('bulkData', ITableBulkData), occurence.ZeroOrMore('blockTableStyle', stylesheet.IBlockTableStyle), ) style = attr.Style( title=u'Style', description=(u'The table style that is applied to the table. '), required=False) rowHeights = attr.Sequence( title=u'Row Heights', description=u'A list of row heights in the table.', value_type=attr.Measurement(), required=False) colWidths = attr.Sequence( title=u'Column Widths', description=u'A list of column widths in the table.', value_type=attr.Measurement(allowPercentage=True, allowStar=True), required=False) repeatRows = attr.Integer( title=u'Repeat Rows', description=u'A flag to repeat rows upon table splits.', required=False) alignment = attr.Choice(title=u'Alignment', description=u'The alignment of whole table.', choices=interfaces.ALIGN_TEXT_CHOICES, required=False)
class IStylesheet(interfaces.IRMLDirectiveSignature): """A styleheet defines the styles that can be used in the document.""" occurence.containing( occurence.ZeroOrOne('initialize', IInitialize), occurence.ZeroOrMore('paraStyle', IParagraphStyle), occurence.ZeroOrMore('blockTableStyle', IBlockTableStyle), # TODO: #occurence.ZeroOrMore('boxStyle', IBoxStyle), )
class IBarChart(IChart): """Creates a two-dimensional bar chart.""" occurence.containing(occurence.One('data', IData1D), occurence.ZeroOrOne('bars', IBars), occurence.ZeroOrOne('categoryAxis', ICategoryAxis), occurence.ZeroOrOne('valueAxis', IValueAxis), occurence.ZeroOrOne('barLabels', IBarLabels), *IChart.queryTaggedValue('directives', ())) direction = attr.Choice( title=u'Direction', description=u'The direction of the bars within the chart.', choices=('horizontal', 'vertical'), default='horizontal', required=False) useAbsolute = attr.Boolean( title=u'Use Absolute Spacing', description=u'Flag to use absolute spacing values.', default=False, required=False) barWidth = attr.Measurement(title=u'Bar Width', description=u'The width of an individual bar.', default=10, required=False) groupSpacing = attr.Measurement( title=u'Group Spacing', description=u'Width between groups of bars.', default=5, required=False) barSpacing = attr.Measurement( title=u'Bar Spacing', description=u'Width between individual bars.', default=0, required=False) barLabelFormat = attr.String( title=u'Bar Label Text Format', description=u'Formatting string for bar labels.', required=False)
class IPageTemplate(interfaces.IRMLDirectiveSignature): """Define a page template.""" occurence.containing( occurence.OneOrMore('frame', IFrame), occurence.ZeroOrOne('pageGraphics', IPageGraphics), occurence.ZeroOrOne('mergePage', page.IMergePage), ) id = attr.Text(title=u'Id', description=u'The id of the template.', required=True) pagesize = attr.PageSize(title=u'Page Size', description=u'The Page Size.', required=False) autoNextTemplate = attr.String( title=u'Auto Next Page Template', description= u'The page template to use automatically for the next page.', required=False)
class ISpiderChart(IChart): """A spider chart.""" occurence.containing(occurence.One('data', IData1D), occurence.ZeroOrOne('strands', IStrands), occurence.ZeroOrOne('strandLabels', IStrandLabels), occurence.ZeroOrOne('spokes', ISpokes), occurence.ZeroOrOne('spokeLabels', ISpokeLabels), occurence.ZeroOrOne('labels', ISimpleLabels), *IChart.queryTaggedValue('directives', ())) startAngle = attr.Integer( title='Start Angle', description='The start angle in the chart of the first strand ' 'in degrees.', required=False) direction = attr.Choice( title='Direction', description='The direction in which the spider chart will be built.', choices=('clockwise', 'anticlockwise'), required=False)
class IPageTemplate(interfaces.IRMLDirectiveSignature): """Define a page template.""" occurence.containing( occurence.OneOrMore('frame', IFrame), occurence.ZeroOrOne('pageGraphics', IPageGraphics), ) id = attr.Text(title=u'Id', description=u'The id of the template.', required=True) pagesize = attr.PageSize(title=u'Page Size', description=u'The Page Size.', required=False) rotation = attr.Integer( title=u'Rotation', description=u'The rotation of the page in multiples of 90 degrees.', required=False)
class ICategoryAxis(IAxis): """An axis displaying categories (instead of numerical values).""" occurence.containing(occurence.ZeroOrOne('categoryNames', ICategoryNames), *IAxis.queryTaggedValue('directives', ())) categoryNames = attr.Sequence( title='Category Names', description='A simple list of category names.', value_type=attr.Text(), required=False) joinAxis = attr.Boolean(title='Join Axis', description='When true, both axes join together.', required=False) joinAxisPos = attr.Measurement( title='Join Axis Position', description='The position at which the axes should join together.', required=False) reverseDirection = attr.Boolean( title='Reverse Direction', description='A flag to reverse the direction of category names.', required=False) labelAxisMode = attr.Choice( title='Label Axis Mode', description='Defines the relative position of the axis labels.', choices=('high', 'low', 'axis'), required=False) tickShift = attr.Boolean( title='Tick Shift', description=('When true, place the ticks in the center of a ' 'category instead the beginning and end.'), required=False)
class IChart(interfaces.IRMLDirectiveSignature): occurence.containing(occurence.ZeroOrOne('texts', ITexts), ) # Drawing Options dx = attr.Measurement( title='Drawing X-Position', description='The x-position of the entire drawing on the canvas.', required=False) dy = attr.Measurement( title='Drawing Y-Position', description='The y-position of the entire drawing on the canvas.', required=False) dwidth = attr.Measurement(title='Drawing Width', description='The width of the entire drawing', required=False) dheight = attr.Measurement(title='Drawing Height', description='The height of the entire drawing', required=False) angle = attr.Float( title='Angle', description='The orientation of the drawing as an angle in degrees.', required=False) # Plot Area Options x = attr.Measurement( title='Chart X-Position', description='The x-position of the chart within the drawing.', required=False) y = attr.Measurement( title='Chart Y-Position', description='The y-position of the chart within the drawing.', required=False) width = attr.Measurement(title='Chart Width', description='The width of the chart.', required=False) height = attr.Measurement(title='Chart Height', description='The height of the chart.', required=False) strokeColor = attr.Color(title='Stroke Color', description='Color of the chart border.', required=False) strokeWidth = attr.Measurement(title='Stroke Width', description='Width of the chart border.', required=False) fillColor = attr.Color(title='Fill Color', description='Color of the chart interior.', required=False) debug = attr.Boolean( title='Debugging', description='A flag that when set to True turns on debug messages.', required=False)