summaryrefslogtreecommitdiff
path: root/silx/_config.py
blob: c9a5c3001d262f692b2f456f48711348cb51ea57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/usr/bin/env python
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2017-2019 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ###########################################################################*/
"""This module contains library wide configuration.
"""

__authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "09/11/2018"


class Config(object):
    """
    Class containing shared global configuration for the silx library.

    .. versionadded:: 0.8
    """

    DEFAULT_PLOT_BACKEND = "matplotlib"
    """Default plot backend.

    It will be used as default backend for all the next created PlotWidget.

    This attribute can be set with:

    - 'matplotlib' (default) or 'mpl'
    - 'opengl', 'gl'
    - 'none'
    - A :class:`silx.gui.plot.backend.BackendBase.BackendBase` class
    - A callable returning backend class or binding name

    .. versionadded:: 0.8
    """

    DEFAULT_COLORMAP_NAME = 'gray'
    """Default LUT for the plot widgets.

    The available list of names are available in the module
    :module:`silx.gui.colors`.

    .. versionadded:: 0.8
    """

    DEFAULT_PLOT_IMAGE_Y_AXIS_ORIENTATION = 'upward'
    """Default Y-axis orientation for plot widget displaying images.

    This attribute can be set with:

    - 'upward' (default), which set the origin to the bottom with an upward
        orientation.
    - 'downward', which set the origin to the top with a backward orientation.

    It will have an influence on:

    - :class:`silx.gui.plot.StackWidget`
    - :class:`silx.gui.plot.ComplexImageView`
    - :class:`silx.gui.plot.Plot2D`
    - :class:`silx.gui.plot.ImageView`

    .. versionadded:: 0.8
    """

    DEFAULT_PLOT_CURVE_COLORS = ['#000000',  # black
                                 '#0000ff',  # blue
                                 '#ff0000',  # red
                                 '#00ff00',  # green
                                 '#ff66ff',  # pink
                                 '#ffff00',  # yellow
                                 '#a52a2a',  # brown
                                 '#00ffff',  # cyan
                                 '#ff00ff',  # magenta
                                 '#ff9900',  # orange
                                 '#6600ff',  # violet
                                 '#a0a0a4',  # grey
                                 '#000080',  # darkBlue
                                 '#800000',  # darkRed
                                 '#008000',  # darkGreen
                                 '#008080',  # darkCyan
                                 '#800080',  # darkMagenta
                                 '#808000',  # darkYellow
                                 '#660000']  # darkBrown
    """Default list of colors for plot widget displaying curves.

    It will have an influence on:

    - :class:`silx.gui.plot.PlotWidget`

    .. versionadded:: 0.9
    """

    DEFAULT_PLOT_CURVE_SYMBOL_MODE = False
    """Whether to display curves with markers or not by default in PlotWidget.

    It will have an influence on PlotWidget curve items.

    .. versionadded:: 0.10
    """

    DEFAULT_PLOT_SYMBOL = 'o'
    """Default marker of the item.

    It will have an influence on PlotWidget items

    Supported symbols:
    
        - 'o', 'Circle'
        - 'd', 'Diamond'
        - 's', 'Square'
        - '+', 'Plus'
        - 'x', 'Cross'
        - '.', 'Point'
        - ',', 'Pixel'
        - '',  'None'

    .. versionadded:: 0.10
    """

    DEFAULT_PLOT_SYMBOL_SIZE = 6.0
    """Default marker size of the item.

    It will have an influence on PlotWidget items

    .. versionadded:: 0.10
    """