Exemplo n.º 1
0
    def addSettings(klass, s):
        """Construct list of settings."""
        BoxShape.addSettings(s)

        s.add(setting.ImageFilename('filename',
                                    '',
                                    descr=_('Image filename'),
                                    usertext=_('Filename'),
                                    formatting=False),
              posn=0)

        s.add(
            setting.Str('embeddedImageData',
                        '',
                        descr=_('Embedded base 64-encoded image data, '
                                'used if filename set to {embedded}'),
                        usertext=_('Embedded data'),
                        hidden=True))

        s.add(setting.Bool('aspect',
                           True,
                           descr=_('Preserve aspect ratio'),
                           usertext=_('Preserve aspect'),
                           formatting=True),
              posn=0)
        s.Border.get('hide').newDefault(True)
Exemplo n.º 2
0
 def addSettings(klass, s):
     """Construct list of settings."""
     veusz.widgets.ImageFile.addSettings(s)
     s.add(
         setting.Str('dataset',
                     '',
                     descr='Source dataset',
                     usertext='Source dataset'), 0)
     s.add(
         setting.Float('target',
                       0,
                       descr='Target time',
                       usertext='Target time'), 1)
     s.add(
         setting.Str('embeddedDataset',
                     '',
                     descr='Dataset source for embedded image',
                     usertext='Dataset source for embedded image',
                     hidden=True))
     s.add(
         setting.Float('embeddedTarget',
                       0,
                       descr='Target time for embedded image',
                       usertext='Target time for embedded image',
                       hidden=True))
     s.add(
         setting.Str(
             'codec',
             'JPG',
             descr='Image codec',
             usertext='Image codec',
         ))
     s.add(
         setting.BoolSwitch(
             'contour',
             False,
             descr='Contour only',
             usertext='Contour only',
             settingstrue=['penWidth'],
         ))
     s.add(
         setting.Int(
             'penWidth',
             0,
             descr='Pen width',
             usertext='Contour width',
         ))
Exemplo n.º 3
0
    def addSettings(klass, s):
        """Construct list of settings."""
        GenericPlotter.addSettings(s)

        s.add(
            setting.Int('steps',
                        50,
                        minval=3,
                        descr=_('Number of steps to evaluate the function'
                                ' over'),
                        usertext=_('Steps'),
                        formatting=True), 0)
        s.add(
            setting.Choice('variable', ['x', 'y'],
                           'x',
                           descr=_('Variable the function is a function of'),
                           usertext=_('Variable')), 0)
        s.add(
            setting.Str('function',
                        'x',
                        descr=_('Function expression'),
                        usertext=_('Function')), 0)

        s.add(
            setting.FloatOrAuto(
                'min',
                'Auto',
                descr=_('Minimum value at which to plot function'),
                usertext=_('Min')))

        s.add(
            setting.FloatOrAuto(
                'max',
                'Auto',
                descr=_('Maximum value at which to plot function'),
                usertext=_('Max')))

        s.add(setting.Line('Line',
                           descr=_('Function line settings'),
                           usertext=_('Plot line')),
              pixmap='settings_plotline')

        s.add(setting.PlotterFill('FillBelow',
                                  descr=_('Fill below function'),
                                  usertext=_('Fill below')),
              pixmap='settings_plotfillbelow')

        s.add(setting.PlotterFill('FillAbove',
                                  descr=_('Fill above function'),
                                  usertext=_('Fill above')),
              pixmap='settings_plotfillabove')
Exemplo n.º 4
0
    def addSettings(klass, s):
        """Construct list of settings."""
        FunctionPlotter.addSettings(s)

        s.add( setting.FloatDict('values',
                                 {'a': 0.0, 'b': 1.0},
                                 descr = _('Variables and fit values'),
                                 usertext=_('Parameters')), 1 )
        s.add( setting.Dataset('xData', 'x',
                               descr = _('Variable containing x data to fit'),
                               usertext=_('X dataset')), 2 )
        s.add( setting.Dataset('yData', 'y',
                               descr = _('Variable containing y data to fit'),
                               usertext=_('Y dataset')), 3 )
        s.add( setting.Bool('fitRange', False,
                            descr = _('Fit only the data between the '
                                      'minimum and maximum of the axis for '
                                      'the function variable'),
                            usertext=_('Fit only range')),
               4 )
        s.add( setting.WidgetChoice(
                'outLabel', '',
                descr=_('Write best fit parameters to this text label '
                        'after fitting'),
                widgettypes=('label',),
                usertext=_('Output label')),
               5 )
        s.add( setting.Str('outExpr', '',
                           descr = _('Output best fitting expression'),
                           usertext=_('Output expression')),
               6, readonly=True )
        s.add( setting.Float('chi2', -1,
                             descr = 'Output chi^2 from fitting',
                             usertext=_('Fit &chi;<sup>2</sup>')),
               7, readonly=True )
        s.add( setting.Int('dof', -1,
                           descr = _('Output degrees of freedom from fitting'),
                           usertext=_('Fit d.o.f.')),
               8, readonly=True )
        s.add( setting.Float('redchi2', -1,
                             descr = _('Output reduced-chi-squared from fitting'),
                             usertext=_('Fit reduced &chi;<sup>2</sup>')),
               9, readonly=True )

        f = s.get('function')
        f.newDefault('a + b*x')
        f.descr = _('Function to fit')

        # modify description
        s.get('min').usertext=_('Min. fit range')
        s.get('max').usertext=_('Max. fit range')
Exemplo n.º 5
0
    def addSettings(klass, s):
        """Construct list of settings."""
        veusz.widgets.Line.addSettings(s)

        s.add(
            setting.Bool('showLabels',
                         True,
                         descr='Show Labels',
                         usertext='Show datapoint labels',
                         formatting=True), 1)
        s.add(
            setting.Str('labelText',
                        '%(xlabel)s=%(x)i \\\\%(ylabel)s=%(y)E',
                        descr='Output labels text',
                        usertext='Output labels text'), 2)
Exemplo n.º 6
0
    def addSettings(klass, s):
        """Construct list of settings."""
        widget.Widget.addSettings(s)

        s.add(
            setting.Str(
                'key',
                '',
                descr=_('Description of the plotted data to appear in key'),
                usertext=_('Key text')))
        s.add(
            setting.Axis('xAxis',
                         'x',
                         'horizontal',
                         descr=_('Name of X-axis to use'),
                         usertext=_('X axis')))
        s.add(
            setting.Axis('yAxis',
                         'y',
                         'vertical',
                         descr=_('Name of Y-axis to use'),
                         usertext=_('Y axis')))
Exemplo n.º 7
0
    def addSettings(klass, s):
        '''Settings for widget.'''
        Widget.addSettings(s)

        s.add( setting.Str('function', 'a',
                           descr=_('Function expression'),
                           usertext=_('Function')) )
        s.add( setting.Choice('variable', ['a', 'b'], 'a',
                              descr=_('Variable the function is a function of'),
                              usertext=_('Variable')) )
        s.add(setting.FloatOrAuto('min', 'Auto',
                                  descr=_('Minimum value at which to plot function'),
                                  usertext=_('Min')))
        
        s.add(setting.FloatOrAuto('max', 'Auto',
                                  descr=_('Maximum value at which to plot function'),
                                  usertext=_('Max')))


        s.add( setting.Line('PlotLine',
                            descr = _('Plot line settings'),
                            usertext = _('Plot line')),
               pixmap = 'settings_plotline' )
        s.add( FillBrush('Fill1',
                         descr = _('Fill settings (1)'),
                         usertext = _('Area fill 1')),
               pixmap = 'settings_plotfillbelow' )
        s.add( FillBrush('Fill2',
                         descr = _('Fill settings (2)'),
                         usertext = _('Area fill 2')),
               pixmap = 'settings_plotfillbelow' )

        s.add( setting.Int('steps', 50,
                           descr = _('Number of steps to evaluate the function'
                                     ' over'),
                           usertext=_('Steps'), formatting=True), 0 )
Exemplo n.º 8
0
    def addSettings(klass, s):
        """Construct list of settings."""
        widget.Widget.addSettings(s)

        s.add( setting.Text('Text',
                            descr = _('Text settings'),
                            usertext=_('Text')),
               pixmap = 'settings_axislabel' )
        s.add( setting.KeyBrush('Background',
                                descr = _('Key background fill'),
                                usertext=_('Background')),
               pixmap = 'settings_bgfill' )
        s.add( setting.Line('Border',
                            descr = _('Key border line'),
                            usertext=_('Border')),
               pixmap = 'settings_border' )

        s.add( setting.Str('title', '',
                           descr=_('Key title text'),
                           usertext=_('Title')) )

        s.add( setting.AlignHorzWManual( 'horzPosn',
                                         'right',
                                         descr = _('Horizontal key position'),
                                         usertext=_('Horz posn'),
                                         formatting=True) )
        s.add( setting.AlignVertWManual( 'vertPosn',
                                         'bottom',
                                         descr = _('Vertical key position'),
                                         usertext=_('Vert posn'),
                                         formatting=True) )
                               
        s.add( setting.Distance('keyLength',
                                '1cm',
                                descr = _('Length of line to show in sample'),
                                usertext=_('Key length'),
                                formatting=True) )
        
        s.add( setting.AlignVert( 'keyAlign',
                                  'top',
                                  descr = _('Alignment of key symbols relative to text'),
                                  usertext = _('Key alignment'),
                                  formatting = True) )

        s.add( setting.Float( 'horzManual',
                              0.,
                              descr = _('Manual horizontal fractional position'),
                              usertext=_('Horz manual'),
                              formatting=True) )
        s.add( setting.Float( 'vertManual',
                              0.,
                              descr = _('Manual vertical fractional position'),
                              usertext=_('Vert manual'),
                              formatting=True) )

        s.add( setting.Float( 'marginSize',
                              1.,
                              minval = 0.,
                              descr = _('Width of margin in characters'),
                              usertext=_('Margin size'),
                              formatting=True) )

        s.add( setting.Int( 'columns',
                            1,
                            descr = _('Number of columns in key'),
                            usertext = _('Columns'),
                            minval = 1,
                            maxval = 100,
                            formatting = True) )
Exemplo n.º 9
0
    def addSettings(klass, s):
        """Construct list of settings."""
        veusz.widgets.BoxShape.addSettings(s)

        s.add(
            setting.Float('remove_gaps_range',
                          100,
                          descr="Remove gaps range",
                          usertext="Remove gaps range"), 1)

        s.add(
            setting.Float('remove_gaps_thershold',
                          10,
                          descr="Remove gaps thershold",
                          usertext="Remove gaps thershold"), 2)

        s.add(
            setting.ChoiceSwitch(
                'search', [
                    'Nearest (Fixed X)', 'Nearest', 'Maximum', 'Minimum',
                    'Inflection', 'Stationary', 'None'
                ],
                'Nearest (Fixed X)',
                settingstrue=['searchRange', 'critical_x'],
                settingsfalse=[],
                showfn=lambda val: not val.startswith('Nearest'),
                descr='Search nearest critical point',
                usertext='Search nearest'), 4)
        s.add(
            setting.Float('searchRange',
                          10,
                          descr='Critical search range',
                          usertext='Search range'), 5)

        s.add(
            setting.Dataset('critical_x',
                            '',
                            descr='Critical search X dataset',
                            usertext='Critical X'), 6)

        s.add(
            setting.WidgetChoice(
                'secondPoint',
                '',
                descr='Second Data Point for passing-through line placement.',
                widgettypes=('datapoint', ),
                usertext='Second Data Point'), 7)
        s.add(
            setting.WidgetChoice(
                'pt2ptLine',
                '',
                descr=
                'Dispose this line as passing through this and second data point.',
                widgettypes=('datapointline', ),
                usertext='Passing-through Line'), 8)

        # OVERRIDES
        n = setting.Choice('positioning', ['axes'],
                           'axes',
                           descr='Axes positioning',
                           usertext='Position mode',
                           formatting=False)
        n.parent = s
        s.setdict['positioning'] = n

        n = setting.DatasetExtended(
            'width', [0.04],
            descr='List of fractional widths or dataset',
            usertext='Widths',
            formatting=False)
        n.parent = s
        s.setdict['width'] = n
        n = setting.DatasetExtended(
            'height', [0.04],
            descr='List of fractional heights or dataset',
            usertext='Heights',
            formatting=False)
        n.parent = s
        s.setdict['height'] = n

        # FORMATTING
        s.add(
            setting.Marker('marker',
                           'linecross',
                           descr='Type of marker to plot',
                           usertext='Marker',
                           formatting=True), 0)

        s.add(
            setting.BoolSwitch('showLabel',
                               True,
                               descr='Show Label',
                               usertext='Show Label',
                               settingstrue=['labelText', 'coordLabel'],
                               formatting=True), 1)
        s.add(
            setting.Str('labelText',
                        '%(xlabel)s=%(x)i \\\\%(ylabel)s=%(y)E',
                        descr='Output label text',
                        usertext='Output label text',
                        formatting=True), 2)
        s.add(
            setting.WidgetChoice('coordLabel',
                                 '',
                                 descr='Write coordinates to this label.',
                                 widgettypes=('datapointlabel', ),
                                 usertext='Coord. label',
                                 formatting=True), 3)

        s.add(
            setting.BoolSwitch('showTangent',
                               False,
                               descr='Show Tangent',
                               usertext='Show tangent line',
                               settingstrue=['tangentLine'],
                               formatting=True), 4)
        s.add(
            setting.WidgetChoice(
                'tangentLine',
                '',
                descr='Dispose this line as tangent to curve xy.',
                widgettypes=('datapointline', ),
                usertext='Tangent Line',
                formatting=True), 5)

        s.add(
            setting.BoolSwitch('showPerpendicular',
                               False,
                               descr='Show Perpend.',
                               usertext='Show perpendicular line',
                               settingstrue=['perpendicularLine'],
                               formatting=True), 6)
        s.add(
            setting.WidgetChoice(
                'perpendicularLine',
                '',
                descr='Dispose this line as perpendicular to curve xy.',
                widgettypes=('datapointline', ),
                usertext='Perpendicular Line',
                formatting=True), 7)
Exemplo n.º 10
0
    def addSettings(klass, s):
        """Construct list of settings."""
        widget.Widget.addSettings(s)
        s.add( setting.Str('label', '',
                           descr=_('Axis label text'),
                           usertext=_('Label')) )
        s.add( setting.AxisBound('min', 'Auto',
                                 descr=_('Minimum value of axis'),
                                 usertext=_('Min')) )
        s.add( setting.AxisBound('max', 'Auto',
                                 descr=_('Maximum value of axis'),
                                 usertext=_('Max')) )
        s.add( setting.Bool('log', False,
                            descr = _('Whether axis is logarithmic'),
                            usertext=_('Log')) )
        s.add( setting.Choice(
                'autoRange',
                ('exact', 'next-tick', '+2%', '+5%', '+10%', '+15%'),
                'next-tick',
                descr = _('If axis range not specified, use range of '
                          'data and this setting'),
                descriptions = (_('Use exact data range'),
                                _('Use data range, rounding up to tick marks'),
                                _('Use data range, adding 2% of range'),
                                _('Use data range, adding 5% of range'),
                                _('Use data range, adding 10% of range'),
                                _('Use data range, adding 15% of range'),
                                ),
                formatting = True,
                usertext = _('Auto range') ) )
        s.add( setting.Choice('mode',
                              ('numeric', 'datetime', 'labels'), 
                              'numeric', 
                              descr = _('Type of ticks to show on on axis'), 
                              usertext=_('Mode')) )

        s.add( setting.SettingBackwardCompat(
                'autoExtend', 'autoRange', True,
                translatefn = lambda x: ('exact', 'next-tick')[x],
                formatting=True ) )

        # this setting no longer used
        s.add( setting.Bool('autoExtendZero', True,
                            descr = _('Extend axis to zero if close (UNUSED)'),
                            usertext=_('Zero extend'),
                            hidden=True,
                            formatting=True) )

        s.add( setting.Bool('autoMirror', True,
                            descr = _('Place axis on opposite side of graph '
                                      'if none'),
                            usertext=_('Auto mirror'),
                            formatting=True) )
        s.add( setting.Bool('reflect', False,
                            descr = _('Place axis text and ticks on other side'
                                      ' of axis'),
                            usertext=_('Reflect'),
                            formatting=True) )
        s.add( setting.Bool('outerticks', False,
                            descr = _('Place ticks on outside of graph'),
                            usertext=_('Outer ticks'),
                            formatting=True) )

        s.add( setting.Float('datascale', 1.,
                             descr=_('Scale data plotted by this factor'),
                             usertext=_('Scale')) )

        s.add( setting.Choice('direction',
                              ['horizontal', 'vertical'],
                              'horizontal',
                              descr = _('Direction of axis'),
                              usertext=_('Direction')) )
        s.add( setting.Float('lowerPosition', 0.,
                             descr=_('Fractional position of lower end of '
                                     'axis on graph'),
                             usertext=_('Min position')) )
        s.add( setting.Float('upperPosition', 1.,
                             descr=_('Fractional position of upper end of '
                                     'axis on graph'),
                             usertext=_('Max position')) )
        s.add( setting.Float('otherPosition', 0.,
                             descr=_('Fractional position of axis '
                                     'in its perpendicular direction'),
                             usertext=_('Axis position')) )

        s.add( setting.WidgetPath('match', '',
                                  descr =
                                  _('Match the scale of this axis to the '
                                    'axis specified'),
                                  usertext=_('Match'),
                                  allowedwidgets = [Axis] ))

        s.add( setting.Line('Line',
                            descr = _('Axis line settings'),
                            usertext = _('Axis line')),
               pixmap='settings_axisline' )
        s.add( AxisLabel('Label',
                         descr = _('Axis label settings'),
                         usertext = _('Axis label')),
               pixmap='settings_axislabel' )
        s.add( TickLabel('TickLabels',
                         descr = _('Tick label settings'),
                         usertext = _('Tick labels')),
               pixmap='settings_axisticklabels' )
        s.add( MajorTick('MajorTicks',
                         descr = _('Major tick line settings'),
                         usertext = _('Major ticks')),
               pixmap='settings_axismajorticks' )
        s.add( MinorTick('MinorTicks',
                         descr = _('Minor tick line settings'),
                         usertext = _('Minor ticks')),
               pixmap='settings_axisminorticks' )
        s.add( GridLine('GridLines',
                        descr = _('Grid line settings'),
                        usertext = _('Grid lines')),
               pixmap='settings_axisgridlines' )
        s.add( MinorGridLine('MinorGridLines',
                             descr = _('Minor grid line settings'),
                             usertext = _('Grid lines for minor ticks')),
               pixmap='settings_axisminorgridlines' )
Exemplo n.º 11
0
    def addSettings(klass, s):
        '''Construct list of settings.'''
        NonOrthGraph.addSettings(s)

        s.add( setting.Choice('mode',
                              ('percentage', 'fraction'),
                              'percentage',
                              descr=_('Show percentages or fractions'),
                              usertext=_('Mode')) )

        s.add( setting.Choice('coords',
                              ('bottom-left', 'bottom-right',
                               'left-bottom', 'left-right',
                               'right-left', 'right-bottom'),
                              'bottom-left',
                              descr=_('Axes to use for plotting coordinates'),
                              usertext=_('Coord system')) )

        s.add( setting.Str('labelbottom', '',
                           descr=_('Bottom axis label text'),
                           usertext=_('Label bottom')) )
        s.add( setting.Str('labelleft', '',
                           descr=_('Left axis label text'),
                           usertext=_('Label left')) )
        s.add( setting.Str('labelright', '',
                           descr=_('Right axis label text'),
                           usertext=_('Label right')) )

        s.add( setting.Float('originleft', 0.,
                             descr=_('Fractional origin of left axis at its top'),
                             usertext=_('Left origin')) )
        s.add( setting.Float('originbottom', 0.,
                             descr=_('Fractional origin of bottom axis at its left'),
                             usertext=_('Bottom origin')) )
        s.add( setting.Float('fracsize', 1.,
                             descr=_('Fractional size of plot'),
                             usertext=_('Size')) )

        s.add( AxisLabel('Label',
                         descr = _('Axis label settings'),
                         usertext = _('Axis label')),
               pixmap='settings_axislabel' )
        s.add( TickLabel('TickLabels',
                         descr = _('Tick label settings'),
                         usertext = _('Tick labels')),
               pixmap='settings_axisticklabels' )
        s.add( MajorTick('MajorTicks',
                         descr = _('Major tick line settings'),
                         usertext = _('Major ticks')),
               pixmap='settings_axismajorticks' )
        s.add( MinorTick('MinorTicks',
                         descr = _('Minor tick line settings'),
                         usertext = _('Minor ticks')),
               pixmap='settings_axisminorticks' )
        s.add( GridLine('GridLines',
                        descr = _('Grid line settings'),
                        usertext = _('Grid lines')),
               pixmap='settings_axisgridlines' )
        s.add( MinorGridLine('MinorGridLines',
                             descr = _('Minor grid line settings'),
                             usertext = _('Grid lines for minor ticks')),
               pixmap='settings_axisminorgridlines' )

        s.get('leftMargin').newDefault('1cm')
        s.get('rightMargin').newDefault('1cm')
        s.get('topMargin').newDefault('1cm')
        s.get('bottomMargin').newDefault('1cm')

        s.MajorTicks.get('number').newDefault(10)
        s.MinorTicks.get('number').newDefault(50)
        s.GridLines.get('hide').newDefault(False)
        s.TickLabels.remove('rotate')