Пример #1
0
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)
Пример #2
0
class ITableStyleCommand(interfaces.IRMLDirectiveSignature):

    start = attr.Sequence(
        title=u'Start Coordinates',
        description=u'The start table coordinates for the style instruction',
        value_type=attr.Combination(
            value_types=(attr.Integer(),
                         attr.Choice(choices=interfaces.SPLIT_CHOICES))
            ),
        default=[0, 0],
        min_length=2,
        max_length=2,
        required=True)

    stop = attr.Sequence(
        title=u'End Coordinates',
        description=u'The end table coordinates for the style instruction',
        value_type=attr.Combination(
            value_types=(attr.Integer(),
                         attr.Choice(choices=interfaces.SPLIT_CHOICES))
            ),
        default=[-1, -1],
        min_length=2,
        max_length=2,
        required=True)
Пример #3
0
class ILink(interfaces.IRMLDirectiveSignature):
    """Place an internal link around a set of flowables."""

    destination = attr.Text(
        title=u'Destination',
        description=u'The name of the destination to link to.',
        required=False)

    url = attr.Text(title=u'URL',
                    description=u'The URL to link to.',
                    required=False)

    boxStrokeWidth = attr.Measurement(
        title=u'Box Stroke Width',
        description=u'The width of the box border line.',
        required=False)

    boxStrokeDashArray = attr.Sequence(
        title=u'Box Stroke Dash Array',
        description=u'The dash array of the box border line.',
        value_type=attr.Float(),
        required=False)

    boxStrokeColor = attr.Color(
        title=u'Box Stroke Color',
        description=(u'The color in which the box border is drawn.'),
        required=False)
Пример #4
0
class ILineMode(interfaces.IRMLDirectiveSignature):
    """Set the line mode for the following graphics elements."""

    width = attr.Measurement(title=u'Width',
                             description=(u'The line width.'),
                             required=False)

    dash = attr.Sequence(title=u'Dash-Pattern',
                         description=(u'The dash-pattern of a line.'),
                         value_type=attr.Measurement(),
                         required=False)

    miterLimit = attr.Measurement(title=u'Miter Limit',
                                  description=(u'The ???.'),
                                  required=False)

    join = attr.Choice(title=u'Join',
                       description=u'The way lines are joined together.',
                       choices=interfaces.JOIN_CHOICES,
                       required=False)

    cap = attr.Choice(
        title=u'Cap',
        description=u'The cap is the desciption of how the line-endings look.',
        choices=interfaces.CAP_CHOICES,
        required=False)
Пример #5
0
class IGrid(interfaces.IRMLDirectiveSignature):
    """A shape to be drawn on the canvas."""

    xs = attr.Sequence(
        title=u'X-Coordinates',
        description=(u'A sequence x-coordinates that represent the vertical '
                     u'line positions.'),
        value_type=attr.Measurement(),
        required=True)

    ys = attr.Sequence(
        title=u'Y-Coordinates',
        description=(u'A sequence y-coordinates that represent the horizontal '
                     u'line positions.'),
        value_type=attr.Measurement(),
        required=True)
Пример #6
0
class ISpoke(interfaces.IRMLDirectiveSignature):
    """A spoke in the spider diagram."""

    strokeWidth = attr.Measurement(
        title='Stroke Width',
        description="The width of the spoke's line.",
        required=False)

    fillColor = attr.Color(title='Fill Color',
                           description="The fill color of the spoke's area.",
                           required=False)

    strokeColor = attr.Color(title='Stroke Color',
                             description='The color of the spoke line.',
                             required=False)

    strokeDashArray = attr.Sequence(
        title='Stroke Dash Array',
        description='The dash array of the spoke line.',
        value_type=attr.Float(),
        required=False)

    labelRadius = attr.Measurement(
        title='Label Radius',
        description='The radius of the label arouns the spoke.',
        required=False)

    visible = attr.Boolean(title='Visible',
                           description='When true, the spoke line is drawn.',
                           required=False)
Пример #7
0
class IStrandBase(interfaces.IRMLDirectiveSignature):

    strokeWidth = attr.Measurement(title='Stroke Width',
                                   description='The line width of the strand.',
                                   required=False)

    fillColor = attr.Color(title='Fill Color',
                           description='The fill color of the strand area.',
                           required=False)

    strokeColor = attr.Color(title='Stroke Color',
                             description='The color of the strand line.',
                             required=False)

    strokeDashArray = attr.Sequence(
        title='Stroke Dash Array',
        description='The dash array of the strand line.',
        value_type=attr.Float(),
        required=False)

    symbol = attr.Symbol(title='Symbol',
                         description='The symbol to use to mark the strand.',
                         required=False)

    symbolSize = attr.Measurement(title='Symbol Size',
                                  description='The size of the strand symbol.',
                                  required=False)
Пример #8
0
class IValueAxis(IAxis):

    forceZero = attr.Boolean(
        title=u'Force Zero',
        description=u'When set, the range will contain the origin.',
        required=False)

    minimumTickSpacing = attr.Measurement(
        title=u'Minimum Tick Spacing',
        description=u'The minimum distance between ticks.',
        required=False)

    maximumTicks = attr.Integer(
        title=u'Maximum Ticks',
        description=u'The maximum number of ticks to be shown.',
        required=False)

    labelTextFormat = attr.String(
        title=u'Label Text Format',
        description=u'Formatting string for axis labels.',
        required=False)

    labelTextPostFormat = attr.Text(
        title=u'Label Text Post Format',
        description=u'An additional formatting string.',
        required=False)

    labelTextScale = attr.Float(
        title=u'Label Text Scale',
        description=u'The sclaing factor for the label tick values.',
        required=False)

    valueMin = attr.Float(title=u'Minimum Value',
                          description=u'The smallest value on the axis.',
                          required=False)

    valueMax = attr.Float(title=u'Maximum Value',
                          description=u'The largest value on the axis.',
                          required=False)

    valueStep = attr.Float(title=u'Value Step',
                           description=u'The step size between ticks',
                           required=False)

    valueSteps = attr.Sequence(
        title=u'Step Sizes',
        description=u'List of step sizes between ticks.',
        value_type=attr.Float(),
        required=False)

    rangeRound = attr.Choice(
        title=u'Range Round',
        description=u'Method to be used to round the range values.',
        choices=('none', 'both', 'ceiling', 'floor'),
        required=False)

    zrangePref = attr.Float(title=u'Zero Range Preference',
                            description=u'Zero range axis limit preference.',
                            required=False)
Пример #9
0
class IBlockColBackground(ITableStyleCommand):
    """Define the background colors for columns."""

    colorNames = attr.Sequence(
        title=u'Colors By Row',
        description=u'A list of colors to be used circularly for rows.',
        value_type=attr.Color(),
        required=True)
Пример #10
0
class ITableBulkData(interfaces.IRMLDirectiveSignature):
    """Bulk Data allows one to quickly create a table."""

    content = attr.TextNodeSequence(title=u'Content',
                                    description=u'The bulk data.',
                                    splitre=re.compile('\n'),
                                    value_type=attr.Sequence(
                                        splitre=re.compile(','),
                                        value_type=attr.Text()))
Пример #11
0
class IHorizontalRow(interfaces.IRMLDirectiveSignature):
    """Create a horizontal line on the page."""

    width = attr.Measurement(
        title=u'Width',
        description=u'The width of the line on the page.',
        allowPercentage=True,
        required=False)

    thickness = attr.Measurement(
        title=u'Thickness',
        description=u'Line Thickness',
        required=False)

    color = attr.Color(
        title=u'Color',
        description=u'The color of the line.',
        required=False)

    lineCap = attr.Choice(
        title=u'Cap',
        description=u'The cap at the end of the line.',
        choices=interfaces.CAP_CHOICES.keys(),
        required=False)

    spaceBefore = attr.Measurement(
        title=u'Space Before',
        description=u'The vertical space before the line.',
        required=False)

    spaceAfter = attr.Measurement(
        title=u'Space After',
        description=u'The vertical space after the line.',
        required=False)

    align = attr.Choice(
        title=u'Alignment',
        description=u'The alignment of the line within the frame.',
        choices=interfaces.ALIGN_TEXT_CHOICES,
        required=False)

    valign = attr.Choice(
        title=u'Vertical Alignment',
        description=u'The vertical alignment of the line.',
        choices=interfaces.VALIGN_TEXT_CHOICES,
        required=False)

    dash = attr.Sequence(
        title=u'Dash-Pattern',
        description=u'The dash-pattern of a line.',
        value_type=attr.Measurement(),
        default=None,
        required=False)
Пример #12
0
class IBlockBackground(ITableStyleCommand):
    """Define the background color of the cells.

    It also supports alternating colors.
    """

    colorName = attr.Color(
        title=u'Color Name',
        description=u'The color to use as the background for every cell.',
        required=False)

    colorsByRow = attr.Sequence(
        title=u'Colors By Row',
        description=u'A list of colors to be used circularly for rows.',
        value_type=attr.Color(acceptNone=True),
        required=False)

    colorsByCol = attr.Sequence(
        title=u'Colors By Column',
        description=u'A list of colors to be used circularly for columns.',
        value_type=attr.Color(acceptNone=True),
        required=False)
Пример #13
0
class ILineStyle(ITableStyleCommand):
    """Define the border line style of each cell."""

    kind = attr.Choice(
        title=u'Kind',
        description=u'The kind of line actions to be taken.',
        choices=('GRID', 'BOX', 'OUTLINE', 'INNERGRID',
                 'LINEBELOW', 'LINEABOVE', 'LINEBEFORE', 'LINEAFTER'),
        required=True)

    thickness = attr.Measurement(
        title=u'Thickness',
        description=u'Line Thickness',
        default=1,
        required=True)

    colorName = attr.Color(
        title=u'Color',
        description=u'The color of the border line.',
        default=None,
        required=True)

    cap = attr.Choice(
        title=u'Cap',
        description=u'The cap at the end of a border line.',
        choices=interfaces.CAP_CHOICES,
        default=1,
        required=True)

    dash = attr.Sequence(
        title=u'Dash-Pattern',
        description=u'The dash-pattern of a line.',
        value_type=attr.Measurement(),
        default=[],
        required=False)

    join = attr.Choice(
        title=u'Join',
        description=u'The way lines are joined together.',
        choices=interfaces.JOIN_CHOICES,
        default=1,
        required=False)

    count = attr.Integer(
        title=u'Count',
        description=(u'Describes whether the line is a single (1) or '
                     u'double (2) line.'),
        default=1,
        required=False)
Пример #14
0
class ILineBase(interfaces.IRMLDirectiveSignature):

    strokeWidth = attr.Measurement(title='Stroke Width',
                                   description='The width of the plot line.',
                                   required=False)

    strokeColor = attr.Color(title='Stroke Color',
                             description='The color of the plot line.',
                             required=False)

    strokeDashArray = attr.Sequence(
        title='Stroke Dash Array',
        description='The dash array of the plot line.',
        value_type=attr.Float(),
        required=False)

    symbol = attr.Symbol(
        title='Symbol',
        description='The symbol to be used for every data point in the plot.',
        required=False)
Пример #15
0
class ISliceBase(interfaces.IRMLDirectiveSignature):

    strokeWidth = attr.Measurement(title='Stroke Width',
                                   description='The wodth of the slice line.',
                                   required=False)

    fillColor = attr.Color(title='Fill Color',
                           description='The fill color of the slice.',
                           required=False)

    strokeColor = attr.Color(title='Stroke Color',
                             description='The color of the pointer line.',
                             required=False)

    strokeDashArray = attr.Sequence(
        title='Stroke Dash Array',
        description='Teh dash array of the slice borderline.',
        value_type=attr.Float(),
        required=False)

    popout = attr.Measurement(
        title='Popout',
        description='The distance of how much the slice should be popped out.',
        required=False)

    fontName = attr.Text(title='Font Name',
                         description='The font name of the label.',
                         required=False)

    fontSize = attr.Measurement(title='Font Size',
                                description='The font size of the label.',
                                required=False)

    labelRadius = attr.Measurement(
        title='Label Radius',
        description=('The radius at which the label should be placed around '
                     'the pie.'),
        required=False)
Пример #16
0
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)
Пример #17
0
class IAxis(interfaces.IRMLDirectiveSignature):
    occurence.containing(occurence.ZeroOrMore('labels', ILabels))

    visible = attr.Boolean(
        title='Visible',
        description='When true, draw the entire axis with all details.',
        required=False)

    visibleAxis = attr.Boolean(title='Visible Axis',
                               description='When true, draw the axis line.',
                               required=False)

    visibleTicks = attr.Boolean(
        title='Visible Ticks',
        description='When true, draw the axis ticks on the line.',
        required=False)

    visibleLabels = attr.Boolean(
        title='Visible Labels',
        description='When true, draw the axis labels.',
        required=False)

    visibleGrid = attr.Boolean(
        title='Visible Grid',
        description='When true, draw the grid lines for the axis.',
        required=False)

    strokeWidth = attr.Measurement(
        title='Stroke Width',
        description='The width of axis line and ticks.',
        required=False)

    strokeColor = attr.Color(
        title='Stroke Color',
        description='The color in which the axis line and ticks are drawn.',
        required=False)

    strokeDashArray = attr.Sequence(
        title='Stroke Dash Array',
        description='The dash array that is used for the axis line and ticks.',
        value_type=attr.Float(),
        required=False)

    gridStrokeWidth = attr.Measurement(
        title='Grid Stroke Width',
        description='The width of the grid lines.',
        required=False)

    gridStrokeColor = attr.Color(
        title='Grid Stroke Color',
        description='The color in which the grid lines are drawn.',
        required=False)

    gridStrokeDashArray = attr.Sequence(
        title='Grid Stroke Dash Array',
        description='The dash array that is used for the grid lines.',
        value_type=attr.Float(),
        required=False)

    gridStart = attr.Measurement(
        title='Grid Start',
        description=('The start of the grid lines with respect to the '
                     'axis origin.'),
        required=False)

    gridEnd = attr.Measurement(
        title='Grid End',
        description=('The end of the grid lines with respect to the '
                     'axis origin.'),
        required=False)

    style = attr.Choice(title='Style',
                        description='The plot style of the common categories.',
                        choices=('parallel', 'stacked', 'parallel_3d'),
                        required=False)